Pattern inspection apparatus and method

ABSTRACT

A fine pattern, such as a semiconductor integrated circuit (LSI), a liquid crystal panel, and a photomask (reticle) for the semiconductor or the liquid crystal panel, which are fabricated based on data for fabricating the fine pattern such as design data is inspected by a pattern inspection apparatus. The pattern inspection apparatus for inspecting a pattern to-be-inspected uses an image of the pattern to-be-inspected and data for fabricating the pattern to-be-inspected. The pattern inspection apparatus includes a reference pattern generation device configured to generate a reference pattern represented by one or more lines from the data, an image generation device configured to generate the image of the pattern to-be-inspected, a detecting device configured to detect an edge of the image of the pattern to-be-inspected, and an inspection device configured to inspect the pattern to-be-inspected by comparing edges of the image of the pattern to-be-inspected with the one or more lines of the reference pattern.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Division of U.S. application Ser. No. 11/434,797filed May 17, 2006, now U.S. Pat. No. 7,796,801, which is acontinuation-in-part application of U.S. application Ser. No. 11/058,616filed Feb. 16, 2005, now U.S. Pat. No. 7,817,844, which is acontinuation-in-part application of U.S. application Ser. No. 10/689,021filed Oct. 21, 2003, now abandoned, which is a continuation-in-partapplication of U.S. application Ser. No. 09/648,372 filed Aug. 25, 2000,now U.S. Pat. No. 6,868,175. All of the aforementioned applications areincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a pattern inspection apparatus andmethod, and more particularly to an apparatus and a method forinspecting a fine pattern, such as a semiconductor integrated circuit(LSI), a liquid crystal panel, and a photomask (reticle) for thesemiconductor or the liquid crystal panel, which are fabricated based ondata for fabricating the fine pattern such as design data.

2. Description of the Related Art

For the pattern inspection of a wafer in a fabricating process ofsemiconductor integrated circuit or the pattern inspection of aphotomask for pattern formation of a wafer, an optical patterninspection apparatus that uses the die-to-die comparison method has beenused. In the die-to-die comparison method, a defect is detected bycomparing an image obtained from a die to-be-inspected and an imageobtained from the equivalent position of a die adjacent to the dieto-be-inspected. In this case, the die means a semiconductor device.

On the other hand, for the inspection of a photomask (reticle) having noadjacent die, the die-to-database comparison method has been used. Inthe die-to-database comparison method, mask data is converted into animage. Then the image is used for a substitution of the image of theadjacent die used in the die-to-die comparison method, and inspection isperformed in the same manner as the above. Here, the mask data is dataobtained by applying photomask correction to design data. The technologyconcerned is disclosed, for example, in U.S. Pat. No. 5,563,702,“Automated photomask inspection apparatus and method.”

However, by using the die-to-database comparison method for waferinspection, corner roundness of a pattern formed on a wafer is likely tobe detected as a defect. In the inspection of a photomask, apretreatment, which adds corner roundness to the image converted fromthe mask data by applying a smoothing filter, prevents the cornerroundness of the pattern from being detected as the defect. However, inthe inspection of a wafer, because the corner roundness added by thepretreatment may be different from corner roundness of each patternactually formed on the wafer, the pretreatment may not perfectly preventthe corner roundness of the pattern from being detected as the defect.Therefore, an allowable pattern deformation quantity should be set inorder to ignore the above difference. As a result, a problem in which afine defect existing in a place except a corner cannot be detected hashappened.

The above problem is not severe for the die-to-database comparisonphotomask inspection, because the photomask should correspond to themask data as much as possible. Therefore, currently, the die-to-databasecomparison photomask inspection has been put into practical use.However, the above problem is severe for the die-to-database comparisonwafer inspection, because a pattern formed on the wafer is allowed to bedeformed as long as an electrical property is guaranteed. This allowablepattern deformation quantity is considerably large. Actually, patterndeformation occurs due to a difference in stepper exposure conditions,or the like. Therefore, the die-to-database comparison wafer inspectionhas not been put into practical use.

From a viewpoint of problems in semiconductor integrated circuitfabrication, repeated defects (systematic defects) are more importantissue than a random defect caused by a particle or the like. Therepeated defects are defined as defects that occur repeatedly over alldies on a wafer caused by photomask failure, or the like. Because therepeated defects occur in a die to-be-inspected and in adjacent diesthat are to be compared with the die to-be-inspected, the die-to-diecomparison wafer inspection cannot detect the repeated defects.Therefore, the die-to-database comparison wafer inspection has beendemanded.

Although the die-to-die comparison wafer inspection has not been putinto practical use because of calculation cost or the like, there havebeen proposed inspection methods in which design data and a wafer imageare used. These inspection methods are disclosed in, for example, aliterature: “Automatic failure part tracing method of a logic LSI usingan electron beam tester,” NEC Technical Report, vol. 50, No. 6, 1997. Inthis literature, the following methods are disclosed: a method in whichprojections of wiring edges on the X- and Y-axes are used; a method inwhich wiring corners are focused on; and a method in which a geneticalgorithm is applied. Moreover, as a method used in this literature, amatching method in which after edges are approximated by straight lines,closed areas are extracted, and the closed areas are used for matchingis described. However, these methods fail to realize an inspection speedthat is usable in high-speed inspection, and fail to perform matchingwhile detecting a pattern deformation quantity.

Further, currently, the automatic defect classification (ADC) method inwhich an image of a die having a defect is used has been used. However,the method cannot classify whether the defect is a killer defect or not,because the method cannot recognize which part of a circuit the defectdestroys.

Moreover, a position of a defect detected by the die-to-die comparisoninspection has an error caused by precision of a stage and an opticalsystem of an inspection apparatus, and such error is approximately tenor more times larger than a line width of a pattern to-be-inspected. Dueto the error, even if a defect position is related with design data,relationship between the defect position and the design data cannot berecognized.

Currently, a line width of semiconductor integrated circuits is farshorter than wavelength used in a lithography process. In thelithography process, a method of adding an OPC (Optical ProximityCorrection) pattern has been used. In the method, by using a photomaskfabricated by mask data that is generated by adding an OPC pattern todesign data, a pattern formed on a wafer fabricated by the photomask canbe consistent with the design data as much as possible. Adding an OPCpattern is one of the most important techniques for photomaskcorrection.

If the OPC pattern does not effectively correct a pattern formed on awafer, repeated defects occur. However, the die-to-die comparison waferinspection cannot detect the repeated defects. In order to solve thisproblem, it is necessary to provide a method in which a pattern formedon the wafer is inspected based on design data in consideration of anallowable pattern deformation quantity.

In addition, in a multi-product/small-volume fabricating process, e.g. asystem-on-a-chip (SoC) fabricating process, a short delivery time isrequired. In the fabricating process, when repeated defects are detectedin electric inspection as a final inspection, a short delivery timecannot be achieved. In order to solve this problem, it is necessary toprovide an inspection method that inspects a difference between apattern formed on a wafer and design data for each lithography process.In the inspection method, it is necessary for an allowable patterndeformation quantity that does not affect an electrical property to beset, and a deformation quantity that exceeds the allowable patterndeformation quantity should be detected.

Further, a lithography simulator inspects a simulation pattern, which isobtained from mask data to which an OPC pattern is added, by comparingthe simulation pattern with design data in order to evaluate the OPCpattern. Although the entire device can be verified by the lithographysimulator, the simulation pattern cannot be necessarily the same as anactual pattern. Moreover, a defect except for a defect caused by the OPCpattern cannot be detected by the lithography simulator. A random defectexisting on a photomask, a stepper aberration, or the like is an exampleof such defect.

Moreover, for verifying the simulation, it is necessary to provide amethod in which a simulation pattern outputted from the lithographysimulator is verified with an image of a pattern actually formed on awafer. Moreover, it becomes increasingly important to improve thetechnology for circuit design by setting an allowable patterndeformation quantity to design data precisely and in detail.

A CD-SEM (Critical Dimension Scanning Electron Microscope) has been usedfor controlling a line width in a fabricating process of semiconductorintegrated circuits. The CD-SEM automatically measures a line width of aline-shaped pattern in a specified position using a line profile.Several positions in several shots on several pieces of wafers for eachlot are measured in order to control stepper exposure condition by usingthe CD-SEM.

As control items in a fabricating process of semiconductor integratedcircuits, end shrinkage of a wiring, a position of an isolated pattern,and the like are also important besides the line width, but theautomatic measuring function of the CD-SEM allows only one-dimensionalmeasurement. Specifically, the CD-SEM can measure only a length such asa line width. Therefore, those two-dimensional shapes are inspected byan operator manually using an image acquired from the CD-SEM or othermicroscopes.

The isolated pattern includes a hole pattern or an island pattern. Theisland pattern may be a negative pattern of the hole pattern. The holepattern includes a contact hole/via hole or a test pattern.

Generally, an OPC pattern plays an important role not only to guaranteea gate line width, but also to form shapes of a corner and an isolatedpattern. Furthermore, because of improvement of a processor frequency,control of a shape of an end of a gate pattern, which is called anend-cap, or a base of a gate pattern, which is called a field extension,also becomes important in addition to the gate line width.

The above inspections of two-dimensional patterns are essential both insampling inspection in a fabricating process, and in an R&D fabricatingprocess. Especially, in the R&D fabricating process, it is necessary toinspect all patterns formed on a wafer. However, currently, the controlof the two-dimensional shape is performed by a human work, and is notperfectly performed. In order to solve this problem, automateddie-to-database comparison wafer inspection is required.

As concrete subjects for automatization, the following subjects areenumerated:

1. In order to detect repeated defects in each semiconductor device, itis practically difficult to check whether there are defects at the samelocation by checking huge defect information.

2. An end except for an end-cap and an end of a wiring pattern to beconnected to a contact hole/via hole may not be corrected by an OPCpattern correctly. Even if the end is shrunken by more than an allowablepattern deformation quantity for an end-cap or an end of a wiringpattern to be connected to a contact hole/via hole, it is not necessaryto recognize the shrunken end as a defect.

3. Conventionally, an overlay error is controlled by measuring limitedareas in a semiconductor device. Therefore, the overlay error causedlocally by a stepper aberration or the like cannot be controlled.

4. The conventional die-to-die comparison method is performed bycomparing corresponding two images. In this method, because thecorresponding two images to be compared have different relationshipbetween a pattern to-be-inspected and pixel boundaries, it is necessaryfor luminance values of pixels to be interpolated so that the two imageshave the same relationship between the pattern to-be-inspected and thepixel boundaries. A problem in which inspection accuracy becomes low bythe interpolation arises.

5. A contour obtained from the second edges can be used for input dataof a lithography simulator or the like. In this case, it is necessary toinput the contour indirectly, because lithography simulator processingis slower than contour output processing.

6. The optimal allowable pattern deformation quantity depends on adesirable electrical property. Therefore, it is necessary to provide amethod of obtaining an optimal allowable pattern deformation quantity byinspecting a standard specimen, which is judged as a semiconductordevice having good quality.

7. For improving quality of semiconductor device, it is necessary forall gate widths in a semiconductor device to be measured, the measuredgate widths are classified based on gate lengths, the minimum distancesto the nearest pattern, or the like, and the gate widths are analyzed.However, by using a conventional CD-SEM, only a limited number of gatewidths in a semiconductor device can be measured and classifiedpractically.

8. As a method of improving quality of an image of a patternto-be-inspected, the image-accumulation method is well known. However,in the case where images of a pattern to-be-inspected on a specimenliable to cause the electrification phenomenon are acquiredsuccessively, a sharp accumulated image cannot be obtained byaccumulating the acquired images simply, because the acquired images aredistorted gradually.

9. In the case of large distortion quantities of the image of thepattern to-be-inspected, vectors between a reference pattern and edgesof an image of a pattern to-be-inspected that exceed an allowabledeformation quantity cannot be obtained, and therefore the distortionquantities of the image of the pattern to-be-inspected may notnecessarily be obtained accurately.

10. In order to improve inspection speed, a method in which an image ofa pattern to-be-inspected is acquired by using a continuously movingstage and a line-sensor is used. However, by using the method, an imageof a pattern to-be-inspected cannot be acquired by performing interlacescan or image-accumulation scan. The image accumulation scan means scan,in which the same scanning line is scanned two or more times in order toacquire an accumulated image.

11. In the case where the conventional automatic focus adjustment usedin a CD-SEM is used for the image generation device with a large fieldof view, it takes a long time to acquire images of a patternto-be-inspected. In addition, because a large area is scannedrepeatedly, a specimen is drastically damaged by an electron beamscanning.

12. In order to measure an FEM wafer, conventionally, several points inall semiconductor devices on a wafer are measured by a CD-SEM. Thepoints to be measured are points suitable for measuring line widths ofline parts of patterns to-be-inspected. However, a tendency for patterndeformation quantities with regard to line widths of line parts ofpatterns to-be-inspected, and a tendency for pattern deformationquantities with regard to space widths of the line parts or a tendencyfor edge placement errors of ends of the patterns to-be-inspected may bedifferent. In such case, if a process window is obtained from theresults of measurement with regard to the line widths of the line partsof the patterns to-be-inspected, a semiconductor fabricated by exposureunder conditions in the process window may have a defect.

13. In order to write a photomask pattern by using an electron beam maskwriter or a laser beam mask writer, there is a method in which a shapedbeam such as a rectangle beam is used for exposure. The shaped beam isdeformed and exposed, so that a photomask pattern may be deformed morethan an allowable pattern deformation quantity. Conventionally, theshaped beam is controlled by exposing a test pattern before writing aphotomask pattern of a product. However, there has not been a method inwhich the shaped beam, which is deformed during the exposure of thephotomask pattern of the product, is controlled.

SUMMARY OF THE INVENTION

In view of the above, it is therefore to provide a pattern inspectionapparatus and method for inspecting a pattern to-be-inspected by usingan image of the pattern to-be-inspected and data for fabricating thepattern to-be-inspected such as design data.

To achieve the above object, according to a first aspect of the presentinvention, there is provided a pattern inspection apparatus forinspecting a pattern to-be-inspected by using an image of the patternto-be-inspected and data for fabricating the pattern to-be-inspected,the pattern inspection apparatus comprising: a reference patterngeneration device configured to generate a reference pattern representedby one or more lines from the data, each of the one or more linescomprising one of a line segment and a curve; an image generation deviceconfigured to generate the image of the pattern to-be-inspected; adetecting device configured to detect an edge of the image of thepattern to-be-inspected; an inspection device configured to inspect thepattern to-be-inspected by comparing the edge of the image of thepattern to-be-inspected with the one or more lines of the referencepattern; and a repeated defect recognition device configured torecognize repeated defects, which relate to the same geometricinformation of the data, from defect information obtained by theinspection device from semiconductor devices that are fabricated basedon the data.

According to a second aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate a reference pattern represented by one or more lines fromthe data, each of the one or more lines comprising one of a line segmentand a curve; an image generation device configured to generate the imageof the pattern to-be-inspected; a detecting device configured to detectan edge of the image of the pattern to-be-inspected; an inspectiondevice configured to obtain defect information from the same inspectionareas with regard to a plurality of semiconductor devices, which arefabricated based on a photomask having a plurality of the same photomaskpatterns, which correspond to the semiconductor device and arefabricated based on the data, by inspecting the pattern to-be-inspectedby comparing the edge of the image of the pattern to-be-inspected withthe one or more lines of the reference pattern; and a repeated defectrecognition device configured to recognize repeated defects from thedefect information with regard to the semiconductor devices fabricatedby one-time exposure using the photomask; wherein the repeated defectrecognition device recognizes an unrepeated defect by removing therepeated defects from all the defects in the defect information, and therepeated defect recognition device judges whether a defect, which is indefect information with regard to semiconductor devices fabricated byanother one-time exposure using the photomask, exists on the samelocation of the photomask coordinates of the unrepeated defect and itsneighborhood.

According to a third aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference patterns; wherein the inspection deviceinspects the pattern to-be-inspected by using inspection result, whichhas been obtained from a pattern to-be-inspected of a specimen that isjudged to have a good quality, in order to ignore nuisance defect.

According to a fourth aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference patterns; wherein the inspection deviceinspects relationship between a location of a pattern formed in aprocess at the time of the inspection and a location of a pattern formedin the preceding process of the process at the time of the inspection,by performing matching between the image of the pattern to-be-inspectedand the reference pattern with regard to the process at the time of theinspection, and performing matching between the image of the patternto-be-inspected and the reference pattern with regard to the precedingprocess of the process at the time of the inspection.

According to a fifth aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; an extracting deviceconfigured to extract a contour by establishing correspondence betweenthe edge of the image of the pattern to-be-inspected and the one or morelines of the reference patterns; and an inspection device configured toinspect the pattern to-be-inspected by comparing the contour, which isextracted by the extracting device, and one of a contour, which isextracted by the extracting device from an image of another patternto-be-inspected fabricated by the data, and a contour, which is obtainedby a simulator using the data.

In preferred aspect of the present invention, the inspection deviceperforms at least one of correction of the contour and reduction ofnoise on the contour by shifting the edge of the image of the patternto-be-inspected.

In preferred aspect of the present invention, the inspection devicereduces noise on the contour by using distances between the referencepatterns represented by the one or more lines and the edges of the imageof the pattern to-be-inspected.

According to a sixth aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; an extracting deviceconfigured to extract a contour by establishing correspondence betweenthe edge of the image of the pattern to-be-inspected and the one or morelines of the reference patterns; an output device configured to outputthe contour extracted by the extracting device; and an inspection deviceconfigured to inspect the pattern to-be-inspected by using the outputtedcontour.

In a preferred aspect of the present invention, the output deviceoutputs the contour by using additional information of the data.

According to a seventh aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference patterns; wherein the inspection deviceinspects repeatedly the same pattern to-be-inspected of a specimen,which is judged to have a good quality, in order to obtain inspectionresults, while altering an allowable pattern deformation quantitysuccessively, and the inspection device obtains an optimal quantity ofthe allowable pattern deformation quantity from the inspection results.

According to an eighth aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference patterns; wherein inspection resultsobtained by the inspection device are classified based on at least oneof geometrical information of the reference pattern, information of thedata, and information of data related to the data.

According to a ninth aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate a pluralityof the images of the pattern to-be-inspected; a detecting deviceconfigured to detect edges of the plurality of the images of the patternto-be-inspected; and an inspection device configured to obtaindistortion quantities of the image of the pattern to-be-inspected bycomparing the edges of the images of the pattern to-be-inspected withthe one or more lines of the reference patterns, correct the pluralityof images of the pattern to-be-inspected by using the obtaineddistortion quantities of the image of the pattern to-be-inspected, andinspect the pattern to-be-inspected by using the plurality of correctedimages of the pattern to-be-inspected.

According to a tenth aspect of the present invention, there is provideda pattern inspection apparatus for inspecting a pattern to-be-inspectedby using an image of the pattern to-be-inspected and data forfabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate a reference pattern represented by one or more lines fromthe data, each of the one or more lines comprising one of a line segmentand a curve; an image generation device configured to generate the imageof the pattern to-be-inspected; a detecting device configured to detectan edge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference pattern; wherein the inspection deviceobtains a distortion quantity of the image of the patternto-be-inspected from distribution of the edges of the image of thepattern to-be-inspected.

In a preferred aspect of the present invention, the inspection deviceobtains at least one of an image rotation quantity and an imagemagnification quantity as the distortion quantity of the image of thepattern to-be-inspected.

In a preferred aspect of the present invention, the inspection deviceobtains the distribution of the edges of the image of the patternto-be-inspected from the edges of the image of the patternto-be-inspected, which exist in a line part of the patternto-be-inspected.

According to an eleventh aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate a reference pattern represented by one or more lines fromthe data, each of the one or more lines comprising one of a line segmentand a curve; an image generation device configured to scan the patternto-be-inspected with a charged particle beam to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference pattern; wherein the image generation devicecontinuously moves a specimen, on which the pattern to-be-inspectedexists, and acquires the image of the pattern to-be-inspected by atleast one of interlace scan and image-accumulation scan.

According to a twelfth aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate a reference pattern represented by one or more lines fromthe data, each of the one or more lines comprising one of a line segmentand a curve; an image generation device configured to scan the patternto-be-inspected with a charged particle beam to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference pattern; wherein the image generation devicescans a specimen, on which the pattern to-be-inspected exists, whilealtering an image adjustment value, and the inspection device obtains anevaluation value corresponding to the image adjustment value from aresult of the inspection.

According to a thirteenth aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference patterns; wherein the inspection deviceobtains a critical area by inspecting the patterns to-be-inspected insemiconductor devices, which are fabricated by exposure under a focuscondition and an exposure dose condition altered, and by detecting atleast one of a defect of at least one of a line part, a corner, and anend, having edge placement errors; an isolated pattern having placementerror; a defect of a corner having abnormal curvature; a defect detectedby inspecting correction pattern that should not be formed on wafer; adefect detected by inspecting at least one of a line width, an averageline width, a space width, and an average space width of a line-shapedpattern; a defect detected by inspecting at least one of a line width,an average line width, a space width, and an average space width of acurvilinear-shaped pattern; and a defect detected by inspecting a gateline width.

According to a fourteenth aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate reference patterns represented by one or more lines from thedata, each of the one or more lines comprising one of a line segment anda curve; an image generation device configured to generate the image ofthe pattern to-be-inspected; a detecting device configured to detect anedge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference patterns; wherein the inspection deviceobtains a process window by inspecting the patterns to-be-inspected insemiconductor devices, which are fabricated by exposure under a focuscondition and an exposure dose condition altered, and by detecting atleast one of a defect of at least one of a line part, a corner, and anend, having edge placement errors; an isolated pattern having placementerror; a defect of a corner having abnormal curvature; a defect detectedby inspecting correction pattern that should not be formed on wafer; adefect detected by inspecting at least one of a line width, an averageline width, a space width, and an average space width of a line-shapedpattern; a defect detected by inspecting at least one of a line width,an average line width, a space width, and an average space width of acurvilinear-shaped pattern; and a defect detected by inspecting a gateline width.

According to a fifteenth aspect of the present invention, there isprovided a pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of the pattern to-be-inspected anddata for fabricating the pattern to-be-inspected, the pattern inspectionapparatus comprising: a reference pattern generation device configuredto generate a reference pattern represented by one or more lines fromthe data, each of the one or more lines comprising one of a line segmentand a curve; an image generation device configured to generate the imageof the pattern to-be-inspected; a detecting device configured to detectan edge of the image of the pattern to-be-inspected; and an inspectiondevice configured to inspect the pattern to-be-inspected by comparingthe edge of the image of the pattern to-be-inspected with the one ormore lines of the reference pattern; wherein the inspection deviceinspects the pattern to-be-inspected using part of the reference patterncorresponding to a fabrication pattern, which is used for fabricatingthe pattern to-be-inspected partially, to obtain deformation quantity ofthe fabrication pattern.

According to a sixteenth aspect of the present invention, there isprovided a method of inspecting a pattern to-be-inspected by using animage of the pattern to-be-inspected and data for fabricating thepattern to-be-inspected, method comprising: generating referencepatterns represented by one or more lines from the data, each of the oneor more lines comprising one of a line segment and a curve; generatingthe image of the pattern to-be-inspected; detecting an edge of the imageof the pattern to-be-inspected; and inspecting the patternto-be-inspected by comparing the edge of the image of the patternto-be-inspected with the one or more lines of the reference patterns;wherein relationship between a location of a pattern formed in a processat the time of the inspection and a location of a pattern formed in thepreceding process of the process at the time of the inspection isinspected, by performing matching between the image of the patternto-be-inspected and the reference pattern with regard to the process atthe time of the inspection, and performing matching between the image ofthe pattern to-be-inspected and the reference pattern with regard to thepreceding process of the process at the time of the inspection.

According to a seventeenth aspect of the present invention, there isprovided a method of inspecting a pattern to-be-inspected by using animage of the pattern to-be-inspected and data for fabricating thepattern to-be-inspected, method comprising: generating referencepatterns represented by one or more lines from the data, each of the oneor more lines comprising one of a line segment and a curve; generatingthe image of the pattern to-be-inspected; detecting an edge of the imageof the pattern to-be-inspected; extracting a contour by establishingcorrespondence between the edge of the image of the patternto-be-inspected and the one or more lines of the reference patterns; andinspecting the pattern to-be-inspected by comparing the contour and oneof a contour, which is extracted from an image of another patternto-be-inspected fabricated by the data, and a contour, which is obtainedby a simulator using the data.

According to an eighteenth aspect of the present invention, there isprovided a method of inspecting a pattern to-be-inspected by using animage of the pattern to-be-inspected and data for fabricating thepattern to-be-inspected, method comprising: generating referencepatterns represented by one or more lines from the data, each of the oneor more lines comprising one of a line segment and a curve; generating aplurality of the images of the pattern to-be-inspected; detecting edgesof the plurality of the images of the pattern to-be-inspected; obtainingdistortion quantities of the image of the pattern to-be-inspected bycomparing the edges of the images of the pattern to-be-inspected withthe one or more lines of the reference patterns; correcting theplurality of images of the pattern to-be-inspected by using the obtaineddistortion quantities of the image of the pattern to-be-inspected; andinspecting the pattern to-be-inspected by using the plurality ofcorrected images of the pattern to-be-inspected.

According to a nineteenth aspect of the present invention, there isprovided a method of inspecting a pattern to-be-inspected by using animage of the pattern to-be-inspected and data for fabricating thepattern to-be-inspected, method comprising: generating referencepatterns represented by one or more lines from the data, each of the oneor more lines comprising one of a line segment and a curve; generatingthe image of the pattern to-be-inspected; detecting an edge of the imageof the pattern to-be-inspected; and inspecting the patternto-be-inspected by comparing the edge of the image of the patternto-be-inspected with the one or more lines of the reference patterns;wherein a critical area is obtained by inspecting the patternsto-be-inspected in semiconductor devices, which are fabricated byexposure under a focus condition and an exposure dose condition altered,and by detecting at least one of a defect of at least one of a linepart, a corner, and an end, having edge placement errors; an isolatedpattern having placement error; a defect of a corner having abnormalcurvature; a defect detected by inspecting correction pattern thatshould not be formed on wafer; a defect detected by inspecting at leastone of a line width, an average line width, a space width, and anaverage space width of a line-shaped pattern; a defect detected byinspecting at least one of a line width, an average line width, a spacewidth, and an average space width of a curvilinear-shaped pattern; and adefect detected by inspecting a gate line width.

According to a twentieth aspect of the present invention, there isprovided a method of inspecting a pattern to-be-inspected by using animage of the pattern to-be-inspected and data for fabricating thepattern to-be-inspected, method comprising: generating referencepatterns represented by one or more lines from the data, each of the oneor more lines comprising one of a line segment and a curve; generatingthe image of the pattern to-be-inspected; detecting an edge of the imageof the pattern to-be-inspected; and inspecting the patternto-be-inspected by comparing the edge of the image of the patternto-be-inspected with the one or more lines of the reference patterns;wherein a process window is obtained by inspecting the patternsto-be-inspected in semiconductor devices, which are fabricated byexposure under a focus condition and an exposure dose condition altered,and by detecting at least one of a defect of at least one of a linepart, a corner, and an end, having edge placement errors; an isolatedpattern having placement error; a defect of a corner having abnormalcurvature; a defect detected by inspecting correction pattern thatshould not be formed on wafer; a defect detected by inspecting at leastone of a line width, an average line width, a space width, and anaverage space width of a line-shaped pattern; a defect detected byinspecting at least one of a line width, an average line width, a spacewidth, and an average space width of a curvilinear-shaped pattern; and adefect detected by inspecting a gate line width.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view, partly in block form, showing a basicarrangement of an image generation device in a pattern inspectionapparatus according to an embodiment of the present invention;

FIG. 2 is a diagram showing an example of reference patterns obtainedfrom design data;

FIG. 3 is a diagram showing an example of an image of a patternto-be-inspected fabricated based on the design data;

FIG. 4 is a diagram showing an outline of inspection processing that thepattern inspection apparatus according to the embodiment of the presentperforms;

FIG. 5 is a schematic view showing intensity of secondary electronsdetected by a secondary electron detector in the image generation deviceshown in FIG. 1;

FIG. 6 is a schematic view showing intensity of the secondary electronsin the case where the pattern P shown in FIG. 5 is turned 90 degrees andprofiles of the pattern P are obtained;

FIG. 7 is a schematic view showing a scanning area used when patternsto-be-inspected are inspected by the pattern inspection apparatusaccording to the embodiment of the present invention;

FIG. 8 is a schematic view illustrative of edge detection accuracy thatis obtained when a pattern to-be-inspected is scanned horizontally;

FIG. 9 is a schematic view illustrative of edge detection accuracy thatis obtained when a pattern to-be-inspected is scanned vertically in anupward direction;

FIG. 10 is a schematic view showing a method in which a pattern isscanned bidirectionally;

FIGS. 11A, 11B, and 11C are schematic views showing methods of scanningin the 45 degree direction or the minus 45 degree direction;

FIG. 12 is a schematic view showing examples of line segments, whichshould be inspected by using either the image scanned at 0 degree or theimage scanned at 90 degrees;

FIG. 13 is a schematic view showing a method in which a rotated image ofa pattern to-be-inspected is obtained by replacing positions of pixels;

FIG. 14 is a schematic view showing an alternative method in which arotated image of a pattern to-be-inspected is obtained by replacingpositions of pixels;

FIG. 15 is a diagram showing an example of basic arrangement of thepattern inspection apparatus according to the embodiment of the presentinvention;

FIG. 16 is a functional block diagram of the pattern inspectionapparatus according to the embodiment of the present invention;

FIG. 17 is a functional block diagram of the pattern inspectionapparatus according to another embodiment of the present invention;

FIG. 18 is a diagram showing an example of correction of a referencepattern;

FIG. 19 is a diagram showing an example of a reference pattern;

FIG. 20 is a diagram showing an example in which the reference patternin FIG. 19 is converted into edges for respective pixels;

FIG. 21 is a diagram showing an example in which the reference patternincluding a curve is converted into edge vectors;

FIG. 22 is a flowchart showing an example of recipe registrationprocessing according to the embodiment of the present invention;

FIG. 23 is a diagram for explaining a sequential inspection;

FIG. 24 is a diagram for explaining a random inspection;

FIG. 25 is a flowchart showing an example of basic inspection processingaccording to the embodiment of the present invention;

FIG. 26 is a sub-block of a flowchart showing an example of inspectionprocessing for recognizing repeated defects;

FIG. 27 is a main block of a flowchart showing an example of theinspection processing for recognizing repeated defects;

FIG. 28 is a diagram showing an example of an image of a patternto-be-inspected having a contrast between the inside of the pattern andthe ground;

FIG. 29 is a diagram showing edges detected from the image of FIG. 28;

FIG. 30 is a diagram showing an example of an image of a patternto-be-inspected having bright edges and having no contrast between theinside of the pattern and the ground;

FIG. 31 is a diagram showing edges detected from the image of FIG. 30;

FIG. 32 is a diagram showing an example of magnitudes of edges of aone-dimensional image of a pattern to-be-inspected;

FIG. 33 is a diagram showing an example in which the edges of FIG. 32are dilated;

FIG. 34 is a diagram showing an example of edges of a one-dimensionalreference pattern;

FIG. 35 is a diagram showing another example in which the edges of FIG.32 are dilated;

FIG. 36 is a diagram showing another example of edges of theone-dimensional reference pattern;

FIG. 37 is a diagram showing another example in which the edges of FIG.32 are dilated;

FIG. 38 is a diagram showing an example of a smoothing filter;

FIG. 39 is a diagram showing an example of magnitudes of edges of atwo-dimensional image of a pattern to-be-inspected;

FIG. 40 is a diagram showing an example in which the edges of FIG. 39are dilated;

FIG. 41 is a diagram showing another example in which the edges of FIG.39 are dilated;

FIG. 42 is a diagram showing an example of edge vectors of thetwo-dimensional image of a pattern to-be-inspected;

FIG. 43 is a diagram showing an example in which the edge vectors inFIG. 42 are dilated;

FIG. 44 is a diagram showing another example in which the edge vectorsin FIG. 42 are dilated;

FIG. 45 is another diagram of FIG. 20 in which the reference pattern inFIG. 19 is expressed with the edge vectors for respective pixels;

FIG. 46 is a diagram for explaining a matching;

FIG. 47 is a diagram made by superimposing FIG. 43 on FIG. 45;

FIG. 48 is another diagram made by superimposing FIG. 43 on FIG. 45;

FIG. 49A is a diagram showing an example of reference patterns;

FIG. 49B is a diagram showing an example of an image of a patternto-be-inspected;

FIG. 50 is a diagram showing an example in which widths of lines andwidths of spaces are equal;

FIG. 51A is a diagram showing an example of reference patterns;

FIG. 51B is a diagram showing an example of the relation between thereference pattern in FIG. 51A and the image of the patternto-be-inspected;

FIGS. 52A and 52B are schematic views showing a method of calculating amatching evaluation value of an array of rectangular patterns;

FIGS. 53A, 53B and 53C are schematic views showing a method ofcalculating a matching evaluation value in which negative patternspaired with unique patterns are used;

FIGS. 54A and 54B are schematic views showing a matching method in whichprojection data obtained by projecting an edge detected by the firstedge detection on the horizontal and vertical axes are used;

FIG. 55 is a schematic view showing calculated matching error valuesE_(pm);

FIG. 56 is a schematic view showing shift quantities recognized to besuitable for matching from the calculated matching error values E_(pm);

FIGS. 57A, 57B and 57C are schematic views showing a method ofcalculating the matching error values E_(pm);

FIGS. 58A, 58B and 58C are schematic views of the first matching methodof a hole pattern;

FIGS. 59A, 59B and 59C are schematic views of the second matching methodof a hole pattern;

FIG. 60 is a diagram showing an example of establishing ofcorrespondence between an edge of the image of the patternto-be-inspected and an edge of the reference pattern;

FIG. 61A is a diagram showing an example of the edges of the referencepattern;

FIG. 61B is a diagram showing an example of the edges of the image ofthe pattern to-be-inspected;

FIG. 62 is a diagram showing another example of the edges of thereference pattern;

FIGS. 63A and 63B are schematic views showing a method of recognizing adefect having abnormal pattern deformation quantity;

FIG. 64 is a schematic view showing a method of recognizing a defectusing luminance distribution of pixels;

FIG. 65 is a diagram showing an example of frequency distribution ofluminance values;

FIG. 66A is a diagram showing an example of edges of a reference patternand edges of an image of a pattern to-be-inspected;

FIG. 66B is a diagram showing an example in which X components of thevectors d(x,y₀) at y=y₀ between two edges shown in FIG. 66A areapproximated by a regression line D(x);

FIG. 67A is a diagram showing another example of the edges of thereference pattern and the edges of the image of the patternto-be-inspected;

FIG. 67B is a diagram showing an example in which the X-components ofthe vectors d(x,y₀) at y=y₀ between the two edges shown in FIG. 67A areapproximated by the regression line D(x);

FIG. 68 is a diagram showing an example of attributes of a referencepattern;

FIGS. 69A and 69B are diagrams showing edge placement errors of an end;

FIG. 70 is a diagram showing a placement error of an isolated pattern;

FIG. 71A is a diagram showing an example of edges of a corner of areference pattern;

FIG. 71B is a diagram showing an example of edges of a corner of animage of a pattern to-be-inspected;

FIG. 72 is a diagram showing an example of profile acquisition sections;

FIG. 73 is a diagram showing a contour of a simulation pattern obtainedby a lithography simulator;

FIG. 74 is a diagram showing an enlarged part of FIG. 72 (portion of B);

FIG. 75 is a diagram showing an enlarged part of FIG. 74 (portion of C);

FIG. 76 is a diagram showing an example of a profile;

FIGS. 77A and 77B are diagrams showing examples in which the detectedsecond edges are approximated by curves (including the polygonapproximation) to connect the detected second edges;

FIG. 78A is a diagram showing another example of the profile acquisitionsections;

FIG. 78B is a diagram showing an example of relation between the firstedges of the image of the pattern to-be-inspected and the secondreference pattern;

FIG. 79 is a schematic view showing an example in which an inspectionarea is divided into four inspection-unit-areas;

FIG. 80 is a schematic view showing defect information obtained from thefirst semiconductor device and defect information obtained from thesecond semiconductor device;

FIG. 81 is a schematic view showing defect information obtained from thefirst semiconductor device and defect information obtained from limitedareas of the second semiconductor device;

FIG. 82 is a schematic view showing an example of patterns which are thesame pattern as feature of the design data, and which have different OPCpatterns;

FIG. 83 is a schematic view showing an example of a plurality ofsemiconductor devices which are fabricated based on a photomask having aplurality of the same photomask patterns fabricated based on the designdata;

FIG. 84 is a schematic view showing a rule for automatically extractingreference patterns suitable for line width inspection from design data;

FIG. 85 is a schematic view showing a method of dividing a line-shapedpattern having a corner into two rectangles at a corner portion;

FIG. 86 is a schematic view showing a rule for automatically extractinga reference pattern suitable for space width inspection from designdata;

FIG. 87 is a schematic view showing an inspection method which uses areference pattern suitable for line width inspection and a referencepattern suitable for space width inspection;

FIG. 88 is a schematic view showing a method of obtaining a referencepattern suitable for line width inspection of a corner part of designdata;

FIG. 89 is a schematic view showing a method of inspecting the minimumline width of a curvilinear-shaped pattern that is the corner part ofthe design data;

FIG. 90 is a schematic view showing a method of inspecting the minimumline width of a curvilinear-shaped pattern that is the corner part ofthe design data, using the erosion operation;

FIG. 91 is a schematic view showing a method of extracting a part thatis liable to cause open or bridge;

FIG. 92 is a schematic view showing a procedure for inspecting a partthat is liable to cause open or bridge;

FIG. 93 is a schematic view showing an inspection method in which areference pattern obtained from a result of the Boolean AND operation ona reference pattern with regard to a process at the time of inspectionand a reference pattern with regard to the preceding process or thesubsequent process is used;

FIG. 94 is a schematic view showing a method in which an allowablepattern deformation quantity of end of wiring pattern to be connected tocontact hole/via hole is adaptively set;

FIGS. 95A and 95B are schematic views showing a method of inspecting acontact-area;

FIG. 96A is a diagram showing an example of correction patterns thatshould not be formed on a wafer;

FIG. 96B is a schematic view showing a method of inspecting correctionpatterns that should not be formed on a wafer;

FIG. 97 is a schematic view showing an example of end shrinkage, whichis more than an allowable pattern deformation quantity of end shrinkagebut is not necessary to be recognized as a defect;

FIG. 98 is a schematic view showing a method of obtaining an optimalallowable pattern deformation quantity;

FIG. 99 is a schematic view showing a method of extracting proximateline segments, which are defined as line segments which face each otherclosest together with a distance between them shorter than apredetermined distance, from reference patterns;

FIG. 100 is a schematic view showing a method of extracting remote linesegments, which are defined as line segments which face each otherclosest together with a distance between them longer than apredetermined distance, from reference patterns;

FIG. 101 is a schematic view showing the case where there is a patternof a lower layer formed in the preceding process beneath a patternto-be-inspected;

FIG. 102 is a schematic view showing an example of an image of a patternto-be-inspected, a reference pattern with regard to a process at thetime of the inspection, and a reference pattern with regard to thepreceding process of the process at the time of the inspection;

FIG. 103 is a flowchart showing a die-to-die comparison method in whichcontours are used;

FIG. 104 is a schematic view showing a die-to-die comparison method inwhich contours are used;

FIG. 105 is a schematic view showing a method of comparing a contourwith the second edge;

FIG. 106 is another schematic view showing a method of comparing acontour with the second edge;

FIG. 107 is a schematic view showing a method of correcting a contour;

FIG. 108 is a schematic view showing a method of reducing a noise on acontour;

FIG. 109 is a schematic view showing a method of reducing noise on acontour by using an average position of the second edge, the precedingedge to the second edge, and the subsequent edge to the second edge;

FIG. 110 is a schematic view showing a method of reducing noise on acontour by using an average of distances between edges of the secondreference pattern and the corresponding second edges of an image of apattern to-be-inspected;

FIG. 111 is a schematic view showing a method of outputting a contour toan external inspection device;

FIG. 112 is a schematic view showing an example in which patterns areformed in line widths different from line widths of design data over theentire semiconductor device due to differences of conditions of patternformation;

FIGS. 113A, 113B and 113C are views showing an example of the firstmethod that obtains a global deformation quantity of an average linewidth using inspected inspection-unit-areas;

FIG. 114 is a view showing an example of the second method of correctingline widths of the design data using the global deformation quantitiesobtained by the first method as shown in FIGS. 113A, 113B and 113C;

FIG. 115 is a view showing an example of a method of calculating adeformation quantity of a line width in 30 degree direction;

FIG. 116 is a schematic view showing a variation in electron beam spotsize on the modified figure drawn from FIG. 23;

FIG. 117 is a schematic view showing a method of determininginspection-unit-areas to be inspected twice;

FIG. 118 is a schematic view showing a method of inspectinginspection-unit-areas twice;

FIG. 119 is a schematic view showing sub-indexes of defect-class, whichare determined by classification according to each line segment in thecase of periodical patterns such as patterns in a memory;

FIG. 120 is a schematic view showing sub-indexes of defect-class thatare used in combination;

FIG. 121 is a schematic view showing a defect location, clippedreference patterns, and the minimum bounding rectangle;

FIG. 122 is a schematic view showing an example of a feature quantityspace;

FIG. 123 is a schematic view showing an example of other featurequantities used in the feature quantity space of FIG. 122;

FIG. 124 is a schematic view showing an example of a distributiondiagram that is created by transforming deformation quantities of theline widths, which are one of the pattern deformation quantitiesobtained from the whole inspection-unit-area, into a gray-scale bitmap,and by superimposing defects;

FIG. 125 is a schematic view showing a method of classifying gate linewidths based on gate lengths;

FIG. 126 is a schematic view showing rectangles, which are used in awriter, obtained by dividing a photomask pattern;

FIG. 127 is a schematic view showing the second edges of an image of apattern to-be-inspected corresponding to the rectangle used in a writer;

FIG. 128 is a schematic view showing four connected circular arcs;

FIGS. 129A and 129B are schematic views showing a method in which ascanning direction for an electron beam is 18 degrees;

FIGS. 130A through 130D are schematic views showing a method of scanninga hexagonal area;

FIG. 131 is a schematic view showing methods of automatically settingscanning conditions based on a reference pattern;

FIG. 132 is a schematic view showing a scanning path for an electronbeam;

FIG. 133 is a schematic view showing another scanning path for anelectron beam;

FIG. 134 is a schematic view showing the filtering of a vertical scan;

FIG. 135 is a schematic view showing a method of scanning only aneighboring portion of edges of a pattern to-be-inspected;

FIG. 136 is a flowchart showing procedure in the method of scanning onlya neighboring portion of edges of a pattern to-be-inspected;

FIGS. 137A and 137B are schematic views showing methods of sequencingacquisition of sampling data when only a neighboring portion of edges ofa pattern to-be-inspected is scanned;

FIGS. 138A, 138B and 138C are schematic views showing a method ofobtaining neighboring portions corresponding to regions for the linewidth inspection method;

FIG. 139 is a schematic view showing a method of performing interlacescan and image-accumulation scan using a continuously moving stage andfeedback of a stage position to deflectors;

FIG. 140 is a schematic view showing interlace scan at 45 degrees in thelower left direction by using the configuration shown in FIG. 139;

FIG. 141 is a schematic view showing scanning waveforms generated by theX deflector and the Y deflector, the XY stage continuously moving aspecimen downward, in the case of performing the interlace scan shown inFIG. 140;

FIG. 142 is a schematic view showing a frame buffer as a memory, inwhich intensities of secondary electrons detected by the secondaryelectron detector are stored;

FIG. 143 is a schematic view showing an image-accumulation scan at 45degrees in the lower left direction by using the configuration shown inFIG. 139;

FIG. 144 is a schematic view showing scanning waveforms generated by theX deflector and the Y deflector, the XY stage continuously moving aspecimen downward, in the case of performing the image-accumulation scanshown in FIG. 143;

FIG. 145 is a schematic view showing a frame buffer as a memory, inwhich intensities of secondary electrons detected by the secondaryelectron detector are added and stored;

FIG. 146 is a schematic view showing an image of a patternto-be-inspected having distortion;

FIG. 147 is a schematic view showing a matching method performed byusing a sub-inspection-unit-area;

FIG. 148 is a schematic view showing methods of correcting distortionquantities of an image of a pattern to-be-inspected;

FIG. 149 is a schematic view showing a method of accumulating images byusing a method of correcting images of a pattern to-be-inspected;

FIG. 150 is a schematic view showing the case of large distortionquantities of the image of the pattern to-be-inspected;

FIG. 151 is a schematic view showing a method of obtaining a center ofthe standard distribution;

FIG. 152 is a view showing the image rotation angle θx and θy;

FIGS. 153A, 153B and 153C are schematic views showing a method ofobtaining distortion quantities of the image of the patternto-be-inspected by using distribution of the first edges of an image ofa pattern to-be-inspected,

FIG. 153A represents the reference pattern and its one-dimensionalprojection translation,

FIG. 153B represents transformed center points and a one-dimensionalprojection translation of the transformed pattern, and

FIG. 153C represents one-dimensional projection data of both thetransformed and the reference pattern;

FIG. 154 is a schematic view showing an example in which distribution ofedges of corner parts of an image of a pattern to-be-inspected isasymmetry;

FIG. 155 is a schematic view showing a method of recognizing the firstedges that exist in corner parts of an image of a patternto-be-inspected;

FIG. 156 is a schematic view showing a method of recognizing the firstedges that exist in line parts of the image of the patternto-be-inspected;

FIG. 157 is a schematic view showing an example of a nonlineardistortion of an image;

FIG. 158 is a schematic view showing an example of construction of adeflection controller;

FIG. 159 is a schematic view showing a method in which the distortioncorrection vector calculation circuit calculates a distortion correctionvector using representative distortion vectors;

FIG. 160A is a schematic view showing a method in which representativedistortion vectors are calculated from distortion vectors in arectangle;

FIG. 160B is a schematic view showing a composed distortion vector;

FIG. 161 is a schematic view showing a method in which therepresentative distortion vectors are calculated from distortion vectorsin a plurality of rectangular regions;

FIGS. 162A and 162B are schematic views showing a method in which thedistortion correction vector calculation circuit converts the distortioncorrection vector into a deflection voltage;

FIG. 163 is a schematic view showing a method of correcting variation inline widths depending on positions of an image of a patternto-be-inspected;

FIG. 164 is a schematic view showing a method of obtaining a regionsuitable for automatic contrast brightness adjustment and automaticfocus adjustment;

FIG. 165 is a schematic view showing examples of a region suitable forautomatic astigmatism adjustment;

FIG. 166 is a schematic view showing a method of obtaining a regionsuitable for automatic astigmatism adjustment;

FIG. 167 is a schematic view showing an automatic focus adjustmentmethod in which the second edge detection method is used;

FIG. 168 is a schematic view showing another automatic focus adjustmentmethod in which the second edge detection method is used;

FIG. 169 is a schematic view showing two sub-inspection-unit-areas;

FIG. 170 is a schematic view showing a method of selecting the mostsuitable sub-inspection-unit-area for matching;

FIG. 171 is a diagram showing an example of inspection using ahigh-magnification image and a low-magnification image;

FIG. 172 is a schematic view showing an example of a display ofsuperimposing design data and mask data on a defect image;

FIGS. 173A, 173B, 173C, and 173D are schematic views showing examples ofdisplaying detected defects as diagrams;

FIG. 174 is a schematic view showing a method in which defects areconverted into design data, and are displayed;

FIG. 175 is a schematic view showing an example of an FEM wafer;

FIG. 176 is a schematic view showing an example of a critical area; and

FIG. 177 is a schematic view showing an example of a process windowobtained by the embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Contents

-   1. Overview-   2. Hardware configuration-   2.1 Basic arrangement of image generation device-   2.2 Scan methods of image generation device-   2.2.1 Scan method 1-   2.2.2 Scan method 2-   2.2.3 Scan method 3-   2.3 Basic arrangement of pattern inspection apparatus-   2.4 Functional block diagram-   3. Explanations of terms-   3.1 Edge-   3.2 Reference pattern-   3.3 Recipe data-   3.4 Inspection-unit-area-   3.5 Inspection results-   4. Basic Inspection processing-   4.1 The first edge detection-   4.1.1 The first edge detection method 1-   4.1.2 The first edge detection method 2-   4.2 Line-shaped pattern matching method-   4.2.1 Matching method in which unique pattern is used-   4.2.2 Matching method in which negative pattern is used-   4.2.3 Matching method in which projection data obtained by    projecting edge on the horizontal and vertical axes are used-   4.3 Matching method in which geometrical information for isolated    pattern is used-   4.4 Matching method in which statistic values for isolated pattern    are used-   4.5 Post-matching processing-   4.6 The first inspection-   4.6.1 Method of recognizing defect having abnormal pattern    deformation quantity-   4.6.2 Method of recognizing defect using luminance distribution of    pixels-   4.7 Method of determining defect-classes based on feature quantity    obtained from image-   4.8 Pattern deformation quantities obtained from the whole    inspection-unit-area-   4.9 Extraction rules for attributes of reference pattern-   4.10 Method of detecting defect using attributes of reference    pattern-   4.10.1 Defect of end having edge placement error-   4.10.2 Defects of line part and corner having edge placement error-   4.10.3 Defects of isolated pattern having placement error-   4.10.4 Other defects of isolated pattern-   4.10.5 Defect of corner having abnormal curvature-   4.11 The second edge detection-   4.12 The second inspection-   5. Application inspection processing-   5.1 Method of recognizing repeated defects-   5.1.1 The first method of recognizing repeated defects-   5.1.2 The second method of recognizing repeated defects-   5.1.3 The third method of recognizing repeated defects-   5.1.4 The fourth method of recognizing repeated defects-   5.2 Region inspection method-   5.2.1 Methods of inspecting line width, average line width, space    width, and average space width of line-shaped pattern-   5.2.2 Methods of inspecting line width, average line width, space    width, and average space width of curvilinear-shaped pattern-   5.2.3 Method of inspecting part that is liable to cause open or    bridge defect-   5.3 Inspection methods in which result of the Boolean operation on    reference patterns is used-   5.3.1 Method of inspecting gate line width-   5.3.2 Method of inspecting end-cap-   5.3.3 Method in which allowable pattern deformation quantity of end    of wiring pattern to be connected to contact hole/via hole is    adaptively set-   5.3.4 Method of inspecting contact-area-   5.4 Method of inspecting correction pattern that should not be    formed on wafer-   5.5 Inspection method in which inspection result of pattern    to-be-inspected of standard semiconductor device is used-   5.6 Method of obtaining optimal allowable pattern deformation    quantity by inspecting standard specimen-   5.7 Method of inspecting patterns requiring signal intensity    correction-   5.8 Method of inspecting pattern to-be-inspected affected by pattern    of preceding process-   5.9 Method of inspecting relationship between location of pattern    to-be-inspected and location of pattern of preceding process-   5.10 Inspection method in which contours are used-   5.10.1 Die-to-die comparison method in which contours are used-   5.10.2 Method of correcting contour and Methods of reducing noise on    contour-   5.10.3 Method of outputting contour to external inspection device-   5.11 Method of separating pattern deformation quantities into global    pattern deformation quantities and local pattern deformation    quantities-   5.12 Method of correcting time-dependence variation in measurement    values of line widths-   5.13 Defect-classes based on geometrical information of reference    pattern, information of design data, or information of data related    to design data-   5.14 Method of grouping defects based on feature of reference    patterns-   5.15 Method of selecting defect image to-be-registered-   5.16 Method of selecting defect to-be-reinspected-   5.17 Method of displaying distribution diagram of pattern    deformation quantities obtained from the whole inspection-unit-area-   5.18 Method of classifying measurement values based on geometrical    information of reference pattern, information of design data, or    information of data related to design data-   5.19 Deformation quantity of pattern exposed by shaped beam-   6. Other scan methods of image generation device-   6.1 Method of scanning electron beam in 18 degrees, Method of    scanning hexagonal area, and Method of automatically determining    scanning conditions based on reference pattern-   6.2 Scanning paths of electron beam in image generation device-   6.3 Method of scanning only neighboring portion of edges of pattern    to-be-inspected-   6.4 Method of scanning only neighboring portions corresponding to    region for region inspection method-   6.5 Method of performing interlace scan and image-accumulation scan    using continuously moving stage-   6.5.1 Method of performing interlace scan using continuously moving    stage-   6.5.2 Method of performing image-accumulation scan using    continuously moving stage-   7. Method of correcting image of pattern to-be-inspected-   7.1 Method of correcting at least one of reference pattern and image    of pattern to-be-inspected by detecting distortion quantities of    image of pattern to-be-inspected-   7.2 Method of accumulating images by using method of correcting    images of pattern to-be-inspected-   7.3 Method of obtaining distortion quantities of image of pattern    to-be-inspected by using distribution of the first edges of image of    pattern to-be-inspected-   7.3.1 Method of obtaining distribution of the first edges of line    part of image of pattern to-be-inspected-   7.4 Method of correcting nonlinear distortion of image-   7.5 Method of correcting variation in line widths depending on    positions of image of pattern to-be-inspected-   8. Other methods-   8.1 Method of extracting region suitable for automatic image    adjustments-   8.2 Automatic focus adjustment method in which the second edge    detection method is used-   8.3 Method of selecting the most suitable sub-inspection-unit-area    for matching-   8.4 Inspection method in which high-magnification image and    low-magnification image are used-   8.5 Display method of superimposing defect information on    information corresponding to the defect-   8.6 Method of measuring FEM wafer-   9. Setting values-   9.1 Setting values of parameters of image generation device-   9.2 Setting values of pixel interval-   10. Modifications of embodiments of present invention

1. Overview

A pattern inspection apparatus according to an embodiment of the presentinvention performs inspection by comparing an image of a patternto-be-inspected obtained from an image generation device 7 shown in FIG.1 with a reference pattern.

FIG. 2 is a diagram showing an example of reference patterns obtainedfrom design data, and FIG. 3 is a diagram showing an example of an imageof a pattern to-be-inspected fabricated based on the design data. Asshown in FIG. 3, the image of the pattern to-be-inspected may have abridge defect, a defect caused by particle adhesion, and a deformationwithin an allowable pattern deformation quantity. Especially, cornershave big corner roundness. Therefore, the image of the patternto-be-inspected is rather different from the reference patterns.

FIG. 4 is a diagram showing an outline of inspection processing that thepattern inspection apparatus according to the embodiment of the presentinvention performs. In the first inspection processing, the first edgesare detected from the image of the pattern to-be-inspected. Then, bycomparing the detected first edges with edges of the first referencepattern, matching between the image of the pattern to-be-inspected andthe reference pattern is performed. As a result of the matching, a shiftquantity S₁ is obtained, and the first reference pattern is shifted bythe shift quantity S₁. Next, by comparing the detected first edges withthe edges of the first reference pattern shifted, the patternto-be-inspected is inspected. In the first inspection, patterndeformation quantities are obtained by comparing the detected firstedges with the edges of the first reference pattern, and then a defectis detected from the pattern deformation quantities. A shift quantity S₂is obtained as one of the pattern deformation quantities.

Then, in order to detect the second edges from the image of the patternto-be-inspected, the second reference pattern is shifted by the shiftquantity S₁+S₂. Using the second reference pattern shifted, profiles areobtained from the image of the pattern to-be-inspected and the secondedges are detected. Then, by comparing the detected second edges withthe edges of the second reference pattern shifted, the patternto-be-inspected is inspected. Also in the second inspection, patterndeformation quantities are obtained by comparing the detected secondedges with the edges of the second reference pattern, and then a defectis detected from the pattern deformation quantities. A shift quantity S₃is obtained as one of the pattern deformation quantities.

By using the above method, the bridge defect, the defect caused byparticle adhesion, and the pattern deformation quantities can bedetected from the image of the pattern to-be-inspected, and the defectsor the pattern deformation quantities can be classified from attributesthat the design data has.

2. Hardware Configuration

2.1 Basic Arrangement of Image Generation Device

FIG. 1 is a schematic view showing, partly in block form, a basicarrangement of the image generation device 7 in the pattern inspectionapparatus according to the embodiment of the present invention. As shownin FIG. 1, the image generation device 7 generally comprises anirradiation system 310, a specimen chamber 320, and a secondary electrondetector 330.

The irradiation system 310 comprises an electron gun 311, a focusinglens 312 for focusing primary electrons emitted from the electron gun311, an X deflector 313 and a Y deflector 314 for deflecting an electronbeam (charged particle beam) in the X and Y directions, respectively,and an objective lens 315. The specimen chamber 320 has an XY stage 321movable in the X and Y directions. A wafer W as a specimen can be loadedinto and unloaded from the specimen chamber 320 by a wafer-loadingdevice 340.

In the irradiation system 310, primary electrons emitted from theelectron gun 311 are focused by the focusing lens 312, deflected by theX deflector 313 and the Y deflector 314, and focused and applied by theobjective lens 315 to a surface of the wafer W.

When the primary electrons are applied to the wafer W, the wafer W emitssecondary electrons, and the secondary electrons are detected by thesecondary electron detector 330. The focusing lens 312 and the objectivelens 315 are connected to a lens controller 316 that is connected to acontrol computer 350. The secondary electron detector 330 is connectedto an image acquisition device 317 that is also connected to the controlcomputer 350. Intensity of the secondary electrons detected by thesecondary electron detector 330 is converted into an image of a patternto-be-inspected by the image acquisition device 317. A field of view isdefined as the largest region where the primary electrons are appliedand an image without distortion can be acquired.

The X deflector 313 and the Y deflector 314 are connected to adeflection controller 318 that is also connected to the control computer350. The XY stage 321 is connected to an XY stage controller 322 that isalso connected to the control computer 350. The wafer-loading device 340is also connected to the control computer 350. The control computer 350is connected to a console computer 360.

2.2 Scan Methods of Image Generation Device

FIG. 5 is a schematic view showing intensity of secondary electronsdetected by the secondary electron detector 330 shown in FIG. 1.Specifically, FIG. 5 shows the intensity of the secondary electrons thatare detected by the secondary electron detector 330 when a pattern Pto-be-inspected is scanned by the one electron beam in the X direction.As shown in FIG. 5, the intensity of the secondary electrons is strongerat edges of the pattern P to-be-inspected due to the edge effect andweaker at a central area of the pattern P to-be-inspected. The intensityof the secondary electrons is not symmetrical horizontally across thepattern P to-be-inspected, but is observed with a lower level at theedge (left edge) where the electron beam starts scanning the pattern Pto-be-inspected than at the opposite edge (right edge) where theelectron beam leaves the pattern P to-be-inspected.

FIG. 6 is a schematic view showing intensity of the secondary electronsin the case where the pattern P to-be-inspected shown in FIG. 5 isturned 90 degrees and profiles of the pattern P to-be-inspected areobtained. Specifically, FIG. 6 shows the intensity of the secondaryelectrons that are detected by the secondary electron detector 330 whenthe pattern P to-be-inspected is scanned by a plurality of electronbeams in the X direction. As shown in FIG. 6, the edge effect at edgesof the pattern P to-be-inspected whose direction is parallel to thescanning direction is difficult to obtain more clearly than in the caseshown in FIG. 5.

FIG. 7 is a schematic view showing a scanning area used when patternsto-be-inspected are inspected by the pattern inspection apparatusaccording to the embodiment of the present invention. In FIG. 7, arectangle shown by dotted lines is an inspection area, which will bedescribed later in 3.4 Inspection-unit-area. Patterns P to-be-inspectedshown by solid lines exist in the inspection area. Inspection isperformed for each inspection-unit-area that is obtained by dividing theinspection area by a field of view. The scanning area means an area thatis scanned by a single scanning process. The maximum size of thescanning area is the field of view. A scanning area, which exists in theinterior of a boundary of the inspection area, is the same as theinspection-unit-area. In the case of a scanning area that includes aboundary of the inspection area, an area that exists in the scanningarea and also exists in the inspection area is the inspection-unit-area.Nine blocks B1 through B9 arranged in a matrix of three vertical columnsand three horizontal rows shown by chain lines are the scanning areas.

The larger difference between a peak and a bottom of a profile obtainedfrom an edge and its neighborhood of an image of a patternto-be-inspected is, the higher edge detection accuracy is. FIG. 8 is aschematic view illustrative of edge detection accuracy that is obtainedwhen a pattern to-be-inspected is scanned horizontally (in the Xdirection). As shown in FIG. 8, when the pattern to-be-inspected isscanned horizontally, edge detection accuracy with regard to edges inthe vertical direction is as high as edge detection accuracy shown inFIG. 5. However, edge detection accuracy with regard to edges in thehorizontal direction is low.

FIG. 9 is a schematic view illustrative of edge detection accuracy thatis obtained when a pattern to-be-inspected is scanned vertically in theupward direction (in the Y direction). As shown in FIG. 9, when thepattern to-be-inspected is scanned vertically, edge detection accuracyis high with regard to edges in the horizontal direction, but is lowwith regard to edges in the vertical direction.

In a lower left block B7 of FIG. 7 where there are edges in thehorizontal direction and edges in the vertical direction, if edgedetection accuracies with regard to the edges in the horizontaldirection and the edges in the vertical direction need to be high, twoscans including the horizontal scan shown in FIG. 8 and the verticalscan shown in FIG. 9 are required. In a block B8 that is to the right ofthe block B7 where there is only edges in the horizontal direction, edgedetection accuracy is high when only the vertical scan shown in FIG. 9is performed. In a middle left block B4 where there is only edges in thevertical direction, edge detection accuracy is high when only thehorizontal scan shown in FIG. 8 is performed. Therefore, by selectivelyperforming the horizontal scan, the vertical scan, or both thehorizontal and vertical scans, a desired image of a patternto-be-inspected is obtained under the scan control.

Because most of patterns to-be-inspected on semiconductor integratedcircuits (LSI) and liquid crystal panels comprise edges in the verticaldirection and edges in the horizontal direction, those patternsto-be-inspected need to be scanned in both the horizontal and verticalscans for detecting the edges of the image of the patternsto-be-inspected composed of edges in the vertical direction and edges inthe horizontal direction with high accuracy.

FIG. 10 is a schematic view showing a method in which a patternto-be-inspected is scanned bidirectionally. As described by using FIG.5, the intensity of the secondary electrons is observed with a lowerlevel at the edge (left edge in FIG. 5) where the electron beam startsscanning the pattern P to-be-inspected than at the opposite edge (rightedge in FIG. 5) where the electron beam leaves the pattern Pto-be-inspected. In view of these observations, an image of a patternto-be-inspected is acquired by scanning the pattern to-be-inspected inalternately opposite directions as shown in FIG. 10. Specifically, theimage of the pattern to-be-inspected is acquired by scanning the patternto-be-inspected alternately in leftward direction and rightwarddirection. Left edges of the pattern to-be-inspected are detected byusing the image of the pattern to-be-inspected acquired by scanning inthe leftward direction, and right edges of the pattern to-be-inspectedare detected by using the image of the pattern to-be-inspected acquiredby scanning in the rightward direction. As a result, high edge detectionaccuracy can be achieved at both the left edges and the right edges ofthe pattern to-be-inspected.

FIGS. 11A, 11B, and 11C are schematic views showing methods of scanningin the 45 degree direction or the minus 45 degree direction. A patternP1 to-be-inspected composed of only edges in the horizontal directionand edges in the vertical direction as shown in FIG. 11A may be scannedonce in the 45 degree direction as shown in FIG. 11B, or in the minus 45degree direction as shown in FIG. 11C to achieve high edge detectionaccuracies with regard to the edges in the horizontal direction and theedges in the vertical direction.

If there is a pattern P2 to-be-inspected composed of edges in the 45degree direction as shown in FIG. 11A, the pattern P2 to-be-inspectedneeds to be scanned twice in the 45 degree direction and in the minus 45degree direction. However, it is expected that a frequency of requiringscan in two directions for the pattern P2 to-be-inspected is smallerthan a frequency of requiring scan in one direction for the pattern P1to-be-inspected composed of edges in the horizontal direction and edgesin the vertical direction. Therefore, scanning in the 45 degreedirection or in the minus 45 degree direction is efficient for achievinghigh edge detection accuracy in the case of one scanning.

Next, the case where scanning in the 45 degree direction and in theminus 45 degree direction is performed will be described. High edgedetection accuracy with regard to edges in the lower right directionthat constitute the pattern P2 to-be-inspected is achieved when thepattern P2 to-be-inspected is scanned in the direction of 45 degrees asshown in FIG. 11B. However, the high edge detection accuracy with regardto edges in the lower right direction cannot be achieved when thepattern P2 to-be-inspected is scanned in the minus 45 degree directionas shown in FIG. 11C, because the scanning direction and direction ofedges are parallel. In the case where an inspection region is inspectedby using scanning in the minus 45 degree direction, aninspection-unit-area including the pattern P2 to-be-inspected isinspected by using scanning in the 45 degree direction and the minus 45degree direction. Generally, a frequency of requiring scanning in the 45degree direction and in the minus 45 degree direction is smaller than afrequency of requiring scanning in the 0 degree direction and in the 90degree direction.

As described in FIGS. 5 through 11, the image generation device 7generates an image of a pattern to-be-inspected according to one of thefollowing three scanning methods:

2.2.1 Scan Method 1

Unidirectional scan in the 0 degree direction, 90 degree direction, 45degree direction, or minus 45 degree direction;

2.2.2 Scan Method 2

Alternate scan in the 0 degree direction and 180 degree direction; and

2.2.3 Scan Method 3

Bidirectional scan in the 0 degree direction and 90 degree direction orbidirectional scan in the 45 degree direction and minus 45 degreedirection.

A coordinate system has the X-axis, whose direction is rightward, andthe Y-axis, whose direction is upward, as the same manner as designdata. A direction of the edge is defined as a direction in which theinterior of the pattern to-be-inspected exists on the right-hand side.In the block B4 in FIG. 7, there are two edges in the verticaldirection, a direction of the left side edge is determined as 90degrees, and a direction of the right side edge is determined as 270degrees.

As described later in 4.1 The first edge detection, the first edge isdetected from a local image of a pattern to-be-inspected. A direction ofthe first edge is determined at the time of detection. A method in whichthe first edge is detected from an image of a pattern to-be-inspectedacquired by the above-mentioned Scan method 1 through Scan method 3 willbe described.

According to the unidirectional scan of the above-mentioned Scan method1, and the alternate scan of the above-mentioned Scan method 2, edgesare detected from a single image of a pattern to-be-inspected. Accordingto the bidirectional scan of the above-mentioned Scan method 3, edgesare detected from two images of a pattern to-be-inspected, and thedetected edge information is merged. Specifically, according to thebidirectional scan in the 0 degree direction and the 90 degreedirection, edges having an angle from 45 degrees to 135 degrees and anangle from 225 degrees to minus 45 degrees are detected from an image ofa pattern to-be-inspected acquired by scanning in the 0 degreedirection, and edges having an angle from 135 degrees to 225 degrees andan angle from minus 45 degrees to 45 degrees are detected from an imageof a pattern to-be-inspected acquired by scanning in the 90 degreedirection, and all detected edges are combined into total edges that arehandled as edges detected from a single image of a patternto-be-inspected.

According to the bidirectional scan in the 45 degree direction and theminus 45 degree direction, edges having an angle from 90 degrees to 180degrees and an angle from 270 degrees to 360 degrees are extracted froman image of a pattern to-be-inspected acquired by scanning in the 45degree direction, and edges having an angle from 0 to 90 degrees and anangle from 180 degrees to 270 degrees are extracted from an image of apattern to-be-inspected acquired by scanning in the minus 45 degreedirection, and all edges are combined into total edges that are handledas edges detected from a single image of a pattern to-be-inspected.

As described later in 4.11 The second edge detection, the second edge isdetected from a profile (one-dimensional data). A direction of thesecond edge is determined at the time of setting the profile. A methodin which the second edge is detected from the profile obtained by theabove-mentioned Scan method 1 through Scan method 3 will be described.

According to the unidirectional scan of the above-mentioned Scan method1, a profile is determined from one image of a pattern to-be-inspected.

According to the alternate scan in the 0 degree direction and 180 degreedirection of the above-mentioned Scan method 2, a profile for detectinga right edge (edges at an angle from 180 degrees to 360 degrees) isobtained from an image of a pattern to-be-inspected acquired by scanningin the 0 degree direction, and a profile for detecting a left edge(edges at an angle from 0 degree to 180 degrees) is obtained from animage of a pattern to-be-inspected acquired by scanning at 180 degrees.

According to the bidirectional scan of the above-mentioned Scan method3, a profile for detecting an edge having an angle from 45 degrees to135 degrees or an angle from 225 degrees to minus 45 degrees is obtainedfrom an image of a pattern to-be-inspected acquired by scanning in the 0degree direction, and a profile for detecting an edge having an anglefrom 135 degrees to 225 degrees or an angle from minus 45 degrees to 45degrees is obtained from an image of a pattern to-be-inspected acquiredby scanning in the 90 degree direction.

FIG. 12 is a schematic view showing examples of line segments, whichshould be inspected by using either the image of the patternto-be-inspected acquired by scanning in the 0 degree direction or theimage of the pattern to-be-inspected acquired by scanning in the 90degree direction. As shown in FIG. 12, line segments of line parts,ends, and corners, which have the vertical direction (90 degrees or 270degrees), the upper left direction (135 degrees), and the lower rightdirection (minus 45 degrees), should be inspected by using an image of apattern to-be-inspected acquired by scanning in the 0 degree direction.Further, line segments of line parts, ends, and corners, which have thehorizontal direction (0 degree or 180 degrees), the upper rightdirection (45 degrees), and the lower left direction (225 degrees),should be inspected by using an image of a pattern to-be-inspectedacquired by scanning in the 90 degree direction.

According to the bidirectional scan in the 45 degree direction and minus45 degree direction, a profile for detecting an edge between an anglefrom 90 degrees to 180 degrees or an angle from 270 degrees to 360degrees is obtained from an image of a pattern to-be-inspected acquiredby scanning in the 45 degree direction, and a profile for detecting anedge between an angle from 0 degree to 90 degrees or an angle from 180degrees to 270 degrees is obtained from an image of a patternto-be-inspected acquired by scanning in the minus 45 degree direction.

In the case where the image of the pattern to-be-inspected is acquiredby scanning in the 45 degree direction or minus 45 degree direction,there is rotation between the acquired image of a patternto-be-inspected and design data, and therefore it is necessary tocompensate for such rotation. As a method for compensating for rotation,a method in which design data is rotated can be used. However, becausedesign data is rotated, the inclined image becomes final output image,and therefore such image is difficult to see. Therefore, a method inwhich an image of a pattern to-be-inspected is rotated is used. However,in the case where scanning is made in order to perform samplinguniformly in the X and Y directions, if an acquired image of a patternto-be-inspected is rotated, interpolated values between pixels must beused as values of the rotated image. In this case, the rotated image ofthe pattern to-be-inspected may be unsharp by interpolation, andtherefore in this embodiment, the rotated image is acquired only byreplacing positions of pixels without using interpolation. In the caseof using this embodiment, it is necessary to use the following scanningmethod.

FIG. 13 is a schematic view showing a method in which a rotated image ofa pattern to-be-inspected is obtained by replacing positions of pixels.An object in a 45 degree inclination scanning method as shown in theleft side of FIG. 13 is the same as an object in a 45 degree inclinationimage as shown in the right side of FIG. 13, with the object in the 45degree inclination image being rotated by 45 degrees. The final image tobe rotated is the image on the right-hand side of FIG. 13. In FIG. 13,grid points show positions of images of a pattern to-be-inspected thatis acquired by uniform sampling in the X and Y directions. Solid circles(●) correspond to positions of actual sampling. Positions where there isno solid circle are not sampled. In order to obtain the image of thepattern to-be-inspected on the right-hand side of FIG. 13, the scanningmethod on the left-hand side of FIG. 13 is performed.

In this case, sampling intervals S in the X direction are the same foreach scanning line, but sampling intervals in the Y direction are halfof the sampling interval S in the X direction. Between odd-numberedlines and even-numbered lines, the positions of sampling are shifted byhalf of the sampling interval S in the X direction. This samplinginterval S is obtained by multiplying the pixel interval on theright-hand side of FIG. 13 by √2. In this manner, a desired image of apattern to-be-inspected can be obtained only by rotating the left sideview. In this case, it is necessary to store values in the orderdifferent from the actual sampling order.

Although FIG. 13 shows the case in which scanning is performed in the 45degree direction, FIG. 14 shows the case in which scanning is performedin the arctangent(2) degree direction, and a rotated image of a patternto-be-inspected.

According to this embodiment, the pattern to-be-inspected may be scannedwith a minimum electron beam (charged particle beam), and therefore theimage of the pattern to-be-inspected can be obtained in a minimum time.In addition, the rotated image of the pattern to-be-inspected can beobtained without lowering image quality due to interpolation, andtherefore the edge detection accuracy can be prevented from beinglowered.

2.3 Basic Arrangement of Pattern Inspection Apparatus

FIG. 15 is a diagram showing an example of basic arrangement of thepattern inspection apparatus according to the embodiment of the presentinvention. The pattern inspection apparatus according to the embodimentof the present invention comprises a main control unit 1, a storagedevice 2, an input/output control unit 3, an input device 4, a displaydevice 5, a printer 6, and the image generation device 7 shown in FIG.1.

The main control unit 1 comprises a CPU (Central Processing Unit) or thelike, and manages and controls the whole apparatus. The main controlunit 1 is connected to the storage device 2. The storage device 2 cantake a form of a hard disk drive, a flexible disk drive, an optical discdrive, and the like. Further, the input device 4 such as a keyboard or amouse, the display device 5 such as a display for displaying the inputdata, calculation results, and the like, and the printer 6 for printinginspection results and the like are connected to the main control unit 1through the input/output control unit 3.

The main control unit 1 has a control program such as an OS (OperatingSystem), a program for the pattern inspection, and an internal memory(internal storage device) for storing necessary data and the like, andrealizes the pattern inspection with these programs and the like. Theseprograms can be initially stored in a flexible disk, an optical discdrive, and the like, read and stored in a memory, a hard disk, and thelike before execution, and then executed.

2.4 Functional Block Diagram

FIG. 16 is a diagram showing a functional block diagram of the patterninspection apparatus in this embodiment. A reference pattern generationunit (reference pattern generation device) 11, an inspection unit(inspection device) 12, an output unit 13, and a defect-classdetermination unit (defect classification device) 14 are all realized byprograms. A fundamental database 21, a recipe database 22, and adefect-class reference database 23 are provided in the storage device 2.The inspection unit (inspection device) 12 includes a detecting devicefor detecting the first edge and the second edge of an image of thepattern to-be-inspected.

Alternatively, the fundamental database 21 may be provided outside thestorage device 2 and the pattern inspection apparatus may access thefundamental database 21 through the LAN (Local Area Network).

FIG. 17 is a diagram showing the functional block diagram of the patterninspection apparatus according to another embodiment of the presentinvention. FIG. 17 shows a structure having a function for recognizingrepeated defects. In the example of FIG. 17, a defect informationstorage unit 24 and a repeated defect recognition unit (repeated defectrecognition device) 25, which recognizes repeated defects, are added tothe functional block of FIG. 16.

3. Explanations of Terms

3.1 Edge

An edge means a boundary between the inside of a pattern to-be-inspectedand a ground. As the edge, an edge of an image of a patternto-be-inspected and an edge of a reference pattern are used. The edge ofthe image of the pattern to-be-inspected is detected by edge detectionmethods, and the edge of the reference pattern is obtained by dividingthe reference pattern represented by one or more lines pixel by pixel.As described by using FIG. 60 in 4.6 The first inspection later,inspection is performed by establishing correspondence between the edgeof the image of the pattern to-be-inspected and the edge of thereference pattern.

The edge is represented by a vector that has information of a startingpoint (with sub pixel accuracy), a direction, and a magnitude for eachpixel. In the case of the edge of the image of the patternto-be-inspected, the magnitude is a length of vector multiplied bysharpness of the edge, where the sharpness is defined as a probabilityof being a real edge. In the case of the edge of the reference pattern,the magnitude is a length of vector multiplied by a degree ofcontribution to matching.

3.2 Reference Pattern

A reference pattern is represented by one or more lines. Each of the oneor more lines comprises one of a line segment and a curve. The referencepattern is compared with an image of a pattern to-be-inspected. Designdata can be used as the most suitable data for the reference pattern. Asthe design data, data obtained by modifying layout data that isrepresented by the GDSII (Graphic Design System II) data stream formatby layer merging or fracturing can be used.

First, the design data is modified in order to be optimal for positionsof edges detected from an image of a pattern to-be-inspected byperforming shrink processing (processing in which magnification of thedesign data is altered), size processing (processing in which a linewidth is altered), and the like. Furthermore, because position of anedge to-be-detected is generally different in the first edge detectionand in the second edge detection, two kinds of reference patterns areprepared for the first edge detection and for the second edge detection.

Next, polygons obtained by the above processing are clipped by arectangle whose one side is equal to the side of the field of view plusan error of the XY stage 321 and the maximum allowable patterndeformation quantity of a pattern to-be-inspected.

Next, corners of the obtained polygons are rounded off. As shown in FIG.18, normally the design data consists of polygons having acute angles(dotted lines in FIG. 18). On the other hand, a pattern to-be-inspectedformed on a wafer has rounded corners. In order to cancel thisdifference, the corners are corrected to be close to the patternto-be-inspected by applying a circle, an ellipse, a straight line, or acurve described by other methods to the corner parts.

Finally, results obtained by the above are registered as a referencepattern into the recipe database 22 beforehand. If the error of the XYstage 321 can be neglected, the absolute coordinate values of thepattern deformation can be measured. In this embodiment, the referencepattern is set to be larger than the image of the patternto-be-inspected in consideration of the error of the XY stage 321 andthe maximum allowable pattern deformation quantity of a patternto-be-inspected to perform inspection. As an alternative method, theimage of the pattern to-be-inspected may be set to be larger than thereference pattern to perform inspection.

If the design data is used as a reference pattern, defect inspection inwhich a pattern to-be-inspected formed on a wafer is compared with thedesign data can be performed. In this case, an allowable quantity thatdoes not affect an electrical property is set. This pattern deformationquantity may be set for each attribute of pattern, and furthermore maybe altered for a portion where patterns are crowded and for a portionwhere patterns are not crowded.

If a curve (solid lines in FIG. 73) representing a contour of asimulation pattern obtained by a lithography simulator is used as areference pattern, the simulation capability can be verified. Thesimulation pattern is expressed by a light intensity distributionobtained by optical simulation using mask data. The curves of thecontour are obtained from the distribution. In this case, an allowablepattern deformation is set to an error quantity that is allowed in thesimulation.

In this embodiment, a method in which the design data is used as thereference pattern will be described.

FIG. 19 is a diagram showing an example of a reference pattern, and FIG.20 is a diagram showing an example in which the reference pattern S ofFIG. 19 is converted into the edges for respective pixels. In FIG. 19,the reference pattern S (dotted lines) is shown with sub pixel accuracy.Normally, edge direction of the reference pattern is parallel to thehorizontal direction (X-direction) or the vertical direction(Y-direction) of the pixel. The edge of the reference pattern, as withan edge of an image of a pattern to-be-inspected, has information of astarting point (with sub pixel accuracy), a direction, and the magnitudefor each pixel. In this embodiment, the edge magnitude of the referencepattern is set to unity, i.e. 1 except for 4.2.1 Matching method inwhich unique pattern is used and 4.2.2 Matching method in which negativepattern is used described later.

As shown in FIG. 21, the reference pattern may include a curve. Forconverting a curvilinear part of the reference pattern into an edge ofthe reference pattern, a tangent line 263 at a point 262 that is on thereference pattern and is closest to the center 261 of the pixel isgenerated.

3.3 Recipe Data

Before the inspection, a set of inspection parameters called recipe datais set. As operator input parameters of the recipe data, design dataretrieval parameters, image acquisition parameters, and edgedetection/inspection parameters are set. As output data of the recipedata, the reference pattern generation unit 11 generates a referencepattern.

As the design data retrieval parameters, a device name and a processname with regard to a wafer (specimen) to-be-inspected are set. As theimage acquisition parameters, a slot number for specifying a wafer,condition-setting parameters for the irradiation system 310, a pixelinterval, the number of pixels and an inspection area are set.

The pixel interval means a distance on the wafer corresponding to aninterval between the pixels of an image of a pattern to-be-inspected.For the number of pixels, 1024×1024, 8192×8192, or the like is set. Thepixel interval is multiplied by the number of pixels, and the obtainedproduct is a size of the image of the pattern to-be-inspected. A regionhaving the size is the field of view, which is described in theabove-mentioned 2.1 Basic arrangement of image generation device. Forexample, in the case where the pixel interval is 9 nm and the number ofpixels is 8192×8192, the field of view is approximately 70 μm×70 μm.

As the edge detection/inspection parameters, the following parametersare set:

1. Pattern Deformation Quantities to be Inspected

-   -   An edge placement error;    -   A deformation quantity of a line width;    -   The minimum line width;    -   A deformation quantity of a space width;    -   The minimum space width;    -   A contact-area inspection ratio;    -   A placement error of the centroid of a pattern, a deformation        quantity of a diameter, and the like, in the case of an isolated        pattern; and    -   A defect judgment coefficient of a correction pattern that        should not be formed on a wafer.

2. Limit values of the negative side and the positive side of theallowable pattern deformation quantities, which correspond to the abovepattern deformation quantities, and a limit of an allowable directionaldifference between edges used for matching.

-   -   These pattern deformation quantities are set for each attribute        of a reference pattern.

3. Parameters for detecting the first edge, which are empiricallydetermined from an image of pattern to-be-inspected.

-   -   The first edge detection method;    -   Coefficients of filter for edge dilation;    -   A threshold used in binarization of edges of an image of a        pattern to-be-inspected; and    -   A p-tile coefficient used in binarization of edges of an image        of a pattern to-be-inspected.

4. Parameters used in extraction rules for determining attributes ofreference pattern (line part, corner, end, isolated pattern, and thelike).

The attributes of the reference pattern are used for specifying part orthe whole of the reference pattern. Typically, there are three kinds ofattributes for specifying part of the reference pattern. One of theattributes is a line part (line part except for an end of the referencepattern), another of the attributes is a corner (portion having a vertexwhich does not contact the line part having the attribute of an end),and the other of the attributes is an end (line part corresponding to anend of the reference pattern). There is an isolated pattern (patternisolated from the other) as an attribute for specifying the whole of thereference pattern.

5. Parameters used in extraction rules for a region suitable for aregion inspection.

-   -   The maximum line width, the minimum line length, and a        termination shortening length of a reference pattern suitable        for line width inspection;    -   The maximum line width, the minimum line length, and a        termination shortening length of a reference pattern suitable        for space width inspection;    -   The maximum line width of a part that is liable to cause an open        defect;    -   The maximum line length of a part that is liable to cause an        open defect;    -   The maximum space width of a part that is liable to cause a        bridge defect; and    -   The maximum space length of a part that is liable to cause a        bridge defect.

6. Parameters for detecting the second edge, which are empiricallydetermined from an image of pattern to-be-inspected.

-   -   A length of a profile acquisition section;    -   An interval between profile acquisition sections;    -   An interval between sampling points in a profile acquisition        section;    -   A method of detecting an edge from a profile (the threshold        method and the like); and    -   A flag for indicating whether profile acquisition sections are        set at the time of setting recipe data, or are set after        detecting the first edges.

7. The minimum size and the maximum size of an isolated pattern, andsafety factors.

8. The number of inspection-unit-areas in order to obtain a globalpattern deformation quantity.

9. The number of maximum registrations of defect images.

10. The number of maximum registrations of defects to-be-reinspected.

11. A region suitable for automatic contrast brightness adjustment,automatic focus adjustment, and automatic astigmatism adjustment.

12. An interval of representative distortion vectors held by adistortion correction vector calculation circuit 414.

The recipe data is managed by using the device name, the process name,and an inspection mode, which are the design data retrieval parameters,as a key. The inspection mode is a generic term for the imageacquisition parameters, and the edge detection/inspection parameters.

FIG. 22 is a flowchart showing an example of recipe registrationprocessing in this embodiment. First, the operator inputs the operatorinput parameters (the design data retrieval parameters, etc.) into thereference pattern generation unit 11 via the input device 4 (step S202).

The reference pattern generation unit 11 retrieves the fundamentaldatabase 21 using the design data retrieval parameters (a device nameand a process name) as a key and takes out the design data (step S204).The fundamental database 21 serves as a database that stores the designdata corresponding to a reference pattern. Next, the reference patterngeneration unit 11 generates a reference pattern based on the designdata (step S206).

Finally, the reference pattern generation unit 11 registers thereference pattern and the operator input parameters into the recipedatabase 22 as recipe data(step S208).

3.4 Inspection-Unit-Area

Because inspection is performed for each inspection-unit-area that isobtained by dividing the inputted inspection area by a field of view, areference pattern is created corresponding to the inspection-unit-area.The inspection includes a sequential inspection or a random inspection.

FIG. 23 is a diagram for explaining the sequential inspection. Theinspection area is not set on the whole wafer, but is set on a pluralityof areas that are specified by rectangles (the upper short rectangle,the lower long rectangle, and the like as shown in FIG. 23), and eachinspection-unit-area is scanned sequentially in order to inspect theareas at high speed. The reference pattern is created for eachinspection-unit-area.

FIG. 24 is a diagram for explaining the random inspection. In the randominspection, a certain area is not inspected sequentially, but limitedareas are inspected. In FIG. 24, only inspection-unit-areas 301 to 304are inspected.

3.5 Inspection Results

Inspection Results Include the Following Basic Information:

1. Information of a defect having an abnormal pattern deformationquantity

2. Information of a defect recognized by using luminance distribution ofpixels

3. Pattern deformation quantities obtained from the wholeinspection-unit-area

The inspection results include the following information, which isobtained by using pattern deformation quantities with regard toattributes of a reference pattern:

4. Information of a defect detected by using the attributes of areference pattern

The results of inspection include the following information, which isobtained by using edges facing each other:

5. Information of a defect detected by the region inspection

4. Basic Inspection processing

FIG. 25 is a flowchart showing an example of basic inspection processingaccording to the embodiment of the present invention. FIGS. 26 and 27are flowcharts showing another example of the inspection processing inthis embodiment, and show inspection processing for recognizing repeateddefects. A block A of FIG. 27 is identical to the block A of FIG. 26,and is a preparation process before the inspection. A block B of FIG. 27is identical to the block B of FIG. 26, and shows an inspection processof each inspection area.

In the basic inspection processing shown in the flowchart of FIG. 25,first, the operator inputs recipe retrieval parameters (a device nameand a process name, and an inspection mode) into the inspection unit 12through the input device 4 (step S302).

The inspection unit 12 retrieves the recipe database 22 using the reciperetrieval parameters as a key and takes out the recipe data including areference pattern (step S304). Then, in order to acquire the image ofthe pattern to-be-inspected, the inspection unit 12 sets the imageacquisition parameters to the image generation device 7 and directs theimage generation device 7 to perform wafer loading, alignment, andcondition-setting for the irradiation system 310 (step S306).

Here, the alignment means a method of obtaining transformationcoefficients between a coordinate system that is used in design data anda coordinate system for controlling an observation position of the wafer(specimen). This method has been embodied by CAD (Computer Aided Design)navigation. The CAD navigation is a well-known method. In the method,after the alignment, the coordinate values of the position of CAD datathat should be observed are transformed into the coordinate values ofcontrolling the observation position of the wafer. Then a field of viewof an image generation device is moved to that position, and an image atthe position is acquired.

As the image generation device 7, a scanning electron microscope shownin FIG. 1 is most suitable. Various scanning microscopes such as ascanning focus ion-beam microscope, a scanning laser microscope, or ascanning probe microscope; or various microscopes may be used.

The image generation device 7 outputs an image of a patternto-be-inspected and a center position of the image to the inspectionunit 12 for each inspection-unit-area (step S308).

4.1 The First Edge Detection

Next, the inspection unit 12 detects the first edge from the image ofthe pattern to-be-inspected (step S310). For the first edge detection,the following two edge detection methods can be used. The first edgedetection method is chosen according to the above-mentioned 3.3 Recipedata “3. The first edge detection method”.

4.1.1 The First Edge Detection Method 1

One is a method suitable for an image having a contrast between theinside of a pattern and the ground. In many of such images, an edge canbe detected through binarization processing. However, in the case wherethe contrast is relatively indistinct, the edges cannot be detectedclearly. In this case, by applying a method disclosed in the literature[reference 1]: R. M. Haralick, “Digital step edges from ZERO crossing ofsecond directional derivatives,” IEEE Trans. Pattern Anal. MachineIntell., Vol. PAMI-6. No. 1, pp. 58-68, 1984 or other methods, the edgescan be detected. By applying this method, a point of inflection on theedge part can be detected with sub pixel accuracy.

4.1.2 The First Edge Detection Method 2

The other is a method that can cope with an image having bright edgesand having no contrast between the inside of a pattern and the ground.For example, a method disclosed in the literature [reference 2]: CartanSteger, “An unbiased detector of curvilinear structures,” IEEE Trans.Pattern Anal. Machine Intell., Vol. 20, No. 2, February 1998, can beused. By using this method, a peak of the edge can be detected with subpixel accuracy. However, in this method, the edge direction has only avalue of 0 to 180 degrees because the inside of the pattern and theground cannot be distinguished.

As an alternative method of the above-mentioned 4.1.1 The first edgedetection method 1, the method of the above-mentioned [literature 2] canbe used. In this case, an image having a contrast between the inside ofthe pattern and the ground is processed by a differential filter (forexample, Sobel filter or a band-pass filter) in order to generate anedge magnitude image, and the edge is detected by using the edgemagnitude image. In this case, the inside of the pattern and the groundcan be distinguished.

Because these methods are processed by using a rather large window, subpixel accuracy can be obtained, and the edge direction can be stable.Therefore, a method, in which the edges are connected and the connectededges are processed by the linear approximation in order to obtainhigher edge detection accuracy, is not necessarily required.

At the first edge detection of step S310, the edge magnitude and theedge direction are obtained from the image of the patternto-be-inspected for each pixel. As described in 3.1 Edge, the magnitudeis a length of vector multiplied by sharpness of the edge. In the caseof an image having a contrast between the inside of the pattern and theground as described in 4.1.1 The first edge detection method 1, by usingthe method of the above-mentioned [literature 1], the absolute value ofthe first derivative of the image can be set as the sharpness of theedge, and the zero cross point of the second derivative of the image canbe taken as the edge position.

On the other hand, in the case of an image having bright edges andhaving no contrast between the inside of a pattern and the ground asdescribed in 4.1.2 The first edge detection method 2, by using themethod of the above-mentioned [literature 2], a sign-inverted value(absolute value) of the second derivative of the image can be set as thesharpness of the edge, and the zero cross point of the first derivativeof the image can be taken as the edge position. In either case, the edgecan be obtained with sub pixel accuracy.

FIG. 28 is a diagram showing an example of an image of a patternto-be-inspected having the contrast between the inside of the patternand the ground as described in 4.1.1 The first edge detection method 1,and FIG. 29 is a diagram showing the edges detected from the image ofFIG. 28. In FIG. 28, a luminance value is shown for each pixel. Theluminance value means a digitized value of intensity of secondaryelectrons. As shown in FIG. 29, an edge is detected for each pixel, andinformation of a starting point (with sub pixel accuracy), a direction(in 0 to 360 degrees), and a magnitude can be obtained for each pixel.As described above, the sharper the edge is, the larger the magnitudebecomes.

FIG. 30 is a diagram showing an example of an image of a patternto-be-inspected having bright edges and having no contrast between theinside of the pattern and the ground described in the above-mentioned4.1.2 The first edge detection method 2, and FIG. 31 is a diagramshowing the edges detected from the image of FIG. 30. In FIG. 30 also,the luminance value is shown for each pixel. Furthermore, as shown inFIG. 31, an edge is detected for each pixel, and information of astarting point (with sub pixel accuracy), a direction (in 0 to 180degrees), and a magnitude can be obtained for each pixel.

4.2 Line-Shaped Pattern Matching Method

Next, the inspection unit 12 dilates the edges of the image of thepattern to-be-inspected. Hereafter, obtained results are called dilatededges (step S312). In this embodiment, the edges are dilated by theallowable pattern deformation quantity that does not affect anelectrical property. In this stage, the allowable pattern deformationquantity is a positive integer. The quantity is the biggest value amongvalues in the above-mentioned 3.3 Recipe data “2. The limit values ofthe negative side and the positive side of the allowable patterndeformation quantities”. By dilating the edges by the allowable patterndeformation quantity, the matching can be performed with the patterndeformation that does not affect an electrical property being allowed.

Methods of obtaining the dilated edges will be described. FIG. 32 is adiagram showing magnitudes of edges of a one-dimensional image of apattern to-be-inspected and FIG. 33 is a diagram showing an example inwhich the edges of FIG. 32 are dilated. The dilated edges are shown inFIG. 33. For simple explanation, one-dimensional data is used in FIG. 32and FIG. 33. As methods of obtaining FIG. 33 from FIG. 32, the followingmethods can be used. In the methods, the magnitudes of the edges areprocessed as an image, and appropriate filters are considered.

In order to ignore the pattern deformation within the allowable patterndeformation quantity, the diagram showing magnitudes of edges in FIG. 32is processed by a maximum value filter having a window that is twice aslarge as the allowable pattern deformation quantity, so that the dilatededges shown in FIG. 33 are obtained. The maximum filter obtains themaximum value among intensity values, which neighboring pixels of atarget pixel have, and sets the obtained maximum value to a value of thetarget pixel of a processed image. In FIG. 33, the edges of the image ofthe pattern to-be-inspected of FIG. 32 are dilated rightward andleftward by two pixels, respectively. This is an example for the casewhere the allowable pattern deformation quantity is two pixels.

The case where edges of a reference pattern are shown in FIG. 34 will beconsidered. First, figures are obtained by shifting FIG. 34. Each shiftquantity used in the above is from two pixels in the leftward directionto two pixels in the rightward direction, respectively. Next, when theevaluation value of the matching is obtained from FIG. 33 and eachshifted figure, each evaluation value has the same value. Therefore, theshift quantity is not determined uniquely. The evaluation value of thematching will be described later.

In order to solve this problem, the edges of FIG. 32 are dilated withweights giving to the neighboring pixels as shown in FIG. 35. In orderto realize the dilation of FIG. 35, a smoothing filter consisting of0.5, 0.75, 1.0, 0.75, and 0.5 coefficients may be used. In the case ofthe example shown in FIG. 35, when FIG. 34 (the edges of the referencepattern) is shifted by one pixel or more in the rightward direction orthe leftward direction, the evaluation value will decrease.

Next, the case where the edges of the reference pattern are wider thanthe edges of the reference pattern shown in FIG. 34 by two pixels asshown in FIG. 36 will be considered. First, figures are obtained byshifting FIG. 36. Shift quantities used in the above are one pixel inthe leftward direction and one pixel in the rightward direction. Next,when the evaluation value of the matching is obtained from FIG. 35 andeach shifted figure, each evaluation value has the same value.Therefore, the shift quantity is not determined uniquely.

In order to solve this problem, the edges of FIG. 32 are dilated withweights giving to the neighboring pixels as shown in FIG. 37. In orderto realize the dilation of FIG. 37, a smoothing filter consisting of0.5, 0.9, 1.0, 0.9, and 0.5 coefficients (FIG. 38) may be used.

From the above consideration, the dilation as shown in FIG. 37 is mostsuitable. However, from a viewpoint of processing speed, crowdedness ofthe edges, and the like, the dilation as shown in FIG. 33 or FIG. 35 maybe used.

After determining the coefficients of the smoothing filter, thecoefficients are set into the above-mentioned 3.3 Recipe data “3. Thecoefficients of filter for edge dilation”, and are used.

FIG. 39 is a diagram showing an example of magnitudes of edges of atwo-dimensional image of a pattern to-be-inspected, and FIGS. 40 and 41are diagrams showing examples in which the edges of FIG. 39 are dilated.In FIG. 39, the magnitudes of edges are all zero except for pixels whosemagnitudes are 20. FIG. 40 shows a result of the same dilation shown inFIG. 33, and FIG. 41 shows a result of the same dilation shown in FIG.37.

FIG. 42 is a diagram showing an example of edge vectors of thetwo-dimensional image of the pattern to-be-inspected, and FIGS. 43 and44 are diagrams showing examples in which the edges of FIG. 42 aredilated. FIG. 43 shows a result of the same dilation shown in FIG. 33,and FIG. 44 shows a result of the same dilation shown in FIG. 37. Thedilation is performed for each X- and Y-component separately.

The inspection unit 12 compares the dilated edges with the edge of thereference pattern, and performs the matching between the image of thepattern to-be-inspected and the reference pattern, pixel by pixel (stepS314).

In this embodiment, the matching is performed by using a shift quantityS₂ with sub pixel accuracy as described in the following description of4.8 Pattern deformation quantities obtained from the wholeinspection-unit-area. Therefore, the matching is performed pixel bypixel for purpose of high-speed calculation. Therefore, as shown in FIG.45, edge vectors, which represent the edge vectors of the referencepattern in FIG. 20 in pixel unit, are used for matching.

In the matching of this embodiment, the reference pattern is shiftedvertically and horizontally for every pixel relatively to the image ofthe pattern to-be-inspected to obtain a position where the evaluationvalue F₀ becomes the maximum, and the obtained position is taken as amatching position (FIG. 46). In this embodiment, as described in thefollowing equation, a total sum of the magnitudes of the dilated edgesin pixels where the edge of the reference pattern exists is used as theevaluation value F₀.

${F_{0}( {x_{s},y_{s}} )} = {\sum\limits_{x = X_{Ea}}^{X_{Eb}}{\sum\limits_{y = Y_{Ea}}^{Y_{Eb}}{{{E( {x,y} )}}{{R( {{x + x_{s}},{y + y_{s}}} )}}}}}$(X_(Ra) − X_(Ea) ≤ x_(s) ≤ X_(Rb) − X_(Eb))(Y_(Ra) − Y_(Ea) ≤ y_(s) ≤ Y_(Rb) − Y_(Eb))where E(x,y) is a vector whose magnitude is equal to the magnitude ofthe dilated edge, and whose direction is equal to the direction of thedilated edge. In pixels where no edge exists, the magnitude of E(x,y) iszero. R (x+x_(s),y+y_(s)) is a vector whose direction is equal to theedge direction of the reference pattern, where the magnitude ofR(x+x_(s),y+y_(s)) is a length of the reference pattern in the pixel.Here, a vector (x_(s),y_(s)) is the shift quantity S₁ of the edge of thereference pattern.

If, in the calculation of F₀, only the pixels whose R(x,y) is non-zeroare stored, the calculation can be performed at high speed and thememory area to be used can be reduced. If truncation of calculationsused in the sequential similarity detection algorithm (SSDA) is adopted,the calculation can be speeded up even further.

FIGS. 47 and 48 are diagrams made by superimposing FIG. 43 (the dilatededges) on FIG. 45 (the edges of the reference pattern). In FIG. 47, apixel 254 corresponds to a pixel 251 of FIG. 43 and a pixel 252 of FIG.45. FIG. 48 shows relationship of positions of FIG. 43 and FIG. 45 inwhich FIG. 43 is shifted by one pixel in rightward direction and by onepixel in downward direction from relationship of positions shown in FIG.47. Therefore, a pixel 255 corresponds to the pixel 251 of FIG. 43 andthe pixel 253 of FIG. 45. By using evaluation value F₀, the larger thedegree of overlapping of the pixels where the edges exist is, the higherthe evaluation value becomes. In the case where the evaluation value F₀is used, the dilation processing as shown in FIGS. 39 through 41 shouldbe performed. In addition, the evaluation value F₀ can be applied toboth images described in the above-mentioned 4.1.1 The first edgedetection method 1 and the above-mentioned 4.1.2 The first edgedetection method 2.

In this embodiment, the above-mentioned evaluation value F₀ is used,however, other evaluation values can also be used. For example, in thecase of the image having the contrast between the inside of the patternand the ground described in the above-mentioned 4.1.1 The first edgedetection method 1, the following evaluation value F_(a) can be used:

${F_{a}( {x_{s},y_{s}} )} = {\sum\limits_{x = X_{Ea}}^{X_{Eb}}{\sum\limits_{y = Y_{Ea}}^{Y_{Eb}}{{E( {x,y} )} \cdot {R( {{x + x_{s}},{y + y_{s}}} )}}}}$(X_(Ra) − X_(Ea) ≤ x_(s) ≤ X_(Rb) − X_(Eb))(Y_(Ra) − Y_(Ea) ≤ y_(s) ≤ Y_(Rb) − Y_(Eb))

Moreover, for example, in the case of the image having bright edges andhaving no contrast between the inside of the pattern and the grounddescribed in the above-mentioned 4.1.2 The first edge detection method2, the following evaluation value F_(b) can be used.

${F_{b}( {x_{s},y_{s}} )} = {\sum\limits_{x = X_{Ea}}^{X_{Eb}}{\sum\limits_{y = Y_{Ea}}^{Y_{Eb}}{{{E( {x,y} )} \cdot {R( {{x + x_{s}},{y + y_{s}}} )}}}}}$(X_(Ra) − X_(Ea) ≤ x_(s) ≤ X_(Rb) − X_(Eb))(Y_(Ra) − Y_(Ea) ≤ y_(s) ≤ Y_(Rb) − Y_(Eb))

In the case where the evaluation value F_(a) or F_(b) is used, thedilation processing as shown in FIGS. 42 through 44 should be performed.

The evaluation values F₀, F_(a), and F_(b) will be considered. Theevaluation value F₀ has advantage with regard to high-speed calculation,because the data is scalar. On the other hand, the evaluation valuesF_(a) and F_(b) are effective, for example, in the case as shown inFIGS. 49A and 49B. When the evaluation values F_(a) and F_(b) are used,because the inner product between the edge (vector) of vertical linepart of the reference pattern (FIG. 49A) and the edge (vector) of thehorizontal line part of the image of the pattern to-be-inspected (FIG.49B) becomes close to zero, a part 101 and a part 102 can be matchedsuccessfully. On the contrary, when the evaluation value F₀ is used,because only the magnitude is used without considering the direction,the part 101 and a part 103 are likely to be matched erroneously.

The evaluation value F_(a) is more robust for matching than theevaluation value F_(b), because the evaluation value F_(a) distinguishesthe inside of the pattern and the ground. For example, in the case wherewidths of lines 111, 113 and widths of spaces 112, 114 are equal asshown in FIG. 50, the value F_(a) can obtain a more suitable result thanthe value F_(b), because distinction between the line and the space isclear.

In this embodiment, the edges of the image of the patternto-be-inspected are dilated and the matching is performed. As analternative method, the edges of the reference pattern may be dilated toperform the matching.

4.2.1 Matching Method in which Unique Pattern is Used

The above-mentioned matching method uses the magnitudes of the edges ofthe reference pattern equally. As described in the above-mentioned 3.1Edge, the magnitude is a length of vector multiplied by a degree ofcontribution to matching. As an alternative method of theabove-mentioned matching method, a matching method in which matching ismore robust by setting different values to the magnitudes of the edgesof the reference pattern can be used. This method is performed in thefollowing procedure using FIGS. 51A and 51B:

FIG. 51A is a diagram showing an example of reference patterns, and FIG.51B is a diagram showing an example of the reference patterns (shown bydotted lines) and an image of a pattern to-be-inspected (shown by solidlines) corresponding to the reference patterns in FIG. 51A. Thereference pattern shown in FIG. 51A is periodic patterns that have a gapat one position. When the matching between the reference patterns andthe image of the pattern to-be-inspected is performed, even if both areshifted by one period as shown in FIG. 51B, most of parts except for thegap part match with each other, and therefore this matching gives a highevaluation value erroneously. In order to solve this problem, a largevalue is set to the degree of contribution to matching of edges ofreference pattern corresponding to the gap part so that the matchingevaluation value will decrease drastically, when the gap of the image ofthe pattern to-be-inspected and the gap of the reference pattern do notmatch with each other.

First, the period of the reference patterns is obtained by theautocorrelation method. Next, by comparing the original referencepatterns with the reference patterns shifted by one period, a referencepattern that exists in part of the original reference patterns, but doesnot exist in the reference pattern shifted by one period is obtained.Then, the obtained reference pattern is recognized as a unique pattern.A degree of contribution to matching of edges of the unique pattern ismade larger value than that of other reference patterns. The value islarger than unity (1). As the value, a constant value obtainedexperimentally, a value defined as a constant value divided by a ratioof the unique pattern to all the patterns, or the like can be used.

4.2.2 Matching Method in which Negative Pattern is Used

In order to utilize the unique pattern more efficiently, a matchingmethod in which a negative pattern paired with the unique pattern isused can be used. FIGS. 52A and 52B are schematic views showing a methodof calculating a matching evaluation value of reference patterns, whichare a periodical array of rectangular pattern. Although rectangularpatterns are periodically arranged also on the right-hand side ofpatterns to-be-inspected shown in FIGS. 52A and 52B, termination of therectangular patterns on the right-hand side cannot be recognized,because the image is limited. In this case, if matching is performed byusing the above-mentioned 4.2.1 Matching method in which unique patternis used, the matching evaluation value in FIG. 52A becomes substantiallyequal to the matching evaluation value in FIG. 52B, and therefore thematching position cannot be uniquely determined.

In order to solve this problem, negative patterns paired with uniquepatterns are extracted by using the following procedure, and theextracted negative patterns are used in calculation of the matchingevaluation value.

FIGS. 53A, 53B and 53C are schematic views showing a method ofcalculating a matching evaluation value in which negative patternspaired with unique patterns are used. If there is no reference patternat a portion shifted from the original reference pattern to the leftwardby one period, the portion of the original reference pattern is taken asthe unique pattern (rectangle shown by dotted lines). The portionshifted from the unique pattern to the leftward by one period is takenas a negative pattern (rectangle shown by solid lines). Similarly, anegative pattern is extracted in other directions such as rightward,upward, and downward.

With regard to the unique pattern, the degree of contribution tomatching is higher than unity (1). On the other hand, with regard to thenegative pattern, the degree of contribution to matching is theabove-mentioned value, which is larger than unity (1), multiplied by(−1).

The evaluation value using the negative pattern will be considered. Anevaluation value when a pattern to-be-inspected exists in one uniquepattern is taken as F1. An evaluation value of FIG. 53A is (3·F₁), anevaluation value of FIG. 53B is (0), and an evaluation value of FIG. 53Cis (3·F₁)−(3·F₁), i.e. nearly equal to (0). From this calculation, thecondition shown in FIG. 53A is recognized as matching position.

According to this embodiment, it is possible to perform matching of theboundary between the region where the same patterns are periodicallyarranged and the other regions, because the negative patterns give ahuge penalty for the evaluation value, in the case of shifting from theoptimal matching position by one period.

4.2.3 Matching Method in which Projection Data Obtained by ProjectingEdge on the Horizontal and Vertical Axes are Used

Although the above matching method is high-speed enough, a method ofperforming at higher speed is required. In order to perform at higherspeed, the portion “matching pixel by pixel” in the step S314 isimproved.

Design data is mostly composed of horizontal lines and vertical lines.By using this characteristic of the design data, it is possible toperform matching at higher speed by using projection data obtained byprojecting edges of a reference pattern on the horizontal and verticalaxes, and projection data obtained by projecting edges of an image of apattern to-be-inspected on the horizontal and vertical axes.

FIGS. 54A and 54B are schematic views showing a matching method in whichprojection data obtained by projecting edges detected by theabove-mentioned 4.1 The first edge detection on the horizontal andvertical axes are used. In this embodiment, the matching method isexplained by using the edge detection suitable for an image having acontrast between the inside of the pattern and the ground as describedin 4.1.1 The first edge detection method 1. The reference patterns arecomposed of line segments that extend in four directions includingupward, downward, rightward and leftward directions. As a representativeexample, a method in which matching is performed by using upward linesegments will be described.

1. A summation L_(rp) of lengths of all line segments that constitutethe reference patterns is obtained. Next, the edges obtained by 4.1.1The first edge detection method 1 are sorted out by magnitudes. TheL_(rp) edges are selected in the descending order of magnitude from thesorted edges and are left, and other edges are eliminated. The referencepatterns are represented by a coordinate system of a pixel unit, and asize of the reference patterns is almost the same as a size of the imageof the pattern to-be-inspected. Therefore, the selected edges correspondto edges of the reference patterns for the most part.

2. The upward line segments that constitute the reference pattern areextracted. The extracted line segments are projected onto the horizontalaxis (the X-axis) to produce one-dimensional data. This one-dimensionaldata is in the form of array, and an index corresponds to an Xcoordinate value and an element corresponds to a length of the linesegments. Similarly, the extracted line segments are projected onto thevertical axis (the Y-axis) to produce one-dimensional data. Thisone-dimensional data is in the form of array, and an index correspondsto a Y coordinate value and an element corresponds to a length of theline segments. This result is shown in FIG. 54A.

3. Upward edges are extracted from the above selected edges. The edgesare projected onto the horizontal axis (the X-axis) to produceone-dimensional data. This one-dimensional data is in the form of array,and an index corresponds to an X coordinate value and an elementcorresponds to a Y component of the edge (vector). Similarly, the edgesare projected onto the vertical axis (the Y-axis) to produceone-dimensional data. This one-dimensional data is in the form of array,and an index corresponds to a Y coordinate value and an elementcorresponds to a Y component of the edge (vector). These results areshown in FIG. 54B.

4. While shifting the projection data of the upward edges onto thehorizontal axis within the range of the X direction shown in FIG. 46,matching error values E_(pm) in the X direction between the projectiondata of the upward edges onto the horizontal axis and the projectiondata of upward line segments onto the horizontal axis are calculated.Similarly, while shifting the projection data of the upward edges ontothe vertical axis within the range of the Y direction shown in FIG. 46,the matching error values E_(pm) in the Y direction between theprojection data of the upward edges onto the vertical axis and theprojection data of upward line segments onto the vertical axis arecalculated. In FIG. 55, the calculated matching error values E_(pm) areshown.

5. The maximum value E_(pmMax) and the minimum value E_(pmMin) ofmatching error values E_(pm) in the X direction are obtained tocalculate a threshold value by the following equation, and a thresholdvalue with regard to the Y direction is calculated by the same manner:E_(pmMin)·k_(mt)+E_(pmMax)(1−k_(mt))

The shift quantities having the matching error values E_(pm) that areequal to or less than the threshold value are recognized to be suitablefor matching. A coefficient k_(mt) is a value that is empiricallydetermined and is in the range of 0 to 1. As the coefficient k_(mt) isnearer to 0, the number of the shift quantities that are recognized tobe suitable for matching becomes larger. The shift quantities shown bythe arrows in FIG. 56 are recognized to be suitable for matching.

6. Next, the optimal solution is obtained from the shift quantities thatare recognized to be suitable for matching in the above step 5. In theabove-mentioned 4.2 Line-shaped pattern matching method, “In thematching of this embodiment, the reference pattern is shifted verticallyand horizontally for every pixel relatively to the image of the patternto-be-inspected to obtain a position where the evaluation value F₀becomes the maximum, and the obtained position is taken as a matchingposition (FIG. 46)” has been explained. According to this method, thisphrase is replaced with “In the matching of this embodiment, thereference pattern is shifted vertically and horizontally for every shiftquantity obtained from the above step 5 relatively to the image of thepattern to-be-inspected to obtain a position where the evaluation valueF₀ becomes the maximum, and the obtained position is taken as a matchingposition (FIG. 46)”, and matching of the above-mentioned Line-shapedpattern matching method is performed.

The matching error value E_(pm) is calculated by the method shown inFIG. 57A. In this embodiment, elements R_(p)[i] of the projection dataof upward line segments onto the horizontal axis, elements E_(p)[i] ofthe projection data of upward edges onto the horizontal axis, and ashift quantity S_(p) are used, as a representative example. The simplematching error value E_(pmS) is calculated by the following equationusing the elements R_(p)[i] of the projection data of upward linesegments onto the horizontal axis, and the shifted elementE_(p)[i+S_(p)] of the projection data of upward edges onto thehorizontal axis:E _(pmS)=Σ_(i) |R _(p) [i]−E _(p) [i+S _(p)]|where Σ_(i) means summation for all the elements E_(p)[i].

As described in the step S312 (dilate the edges of the image of thepattern to-be-inspected to obtain dilated edges), the patterndeformation within the allowable pattern deformation quantity that doesnot affect an electrical property is necessary to be ignored.

Although the same manner as the step S312 may be used, in this case, thefollowing different manner is used.

The case where the allowable pattern deformation quantity is one pixelwill be described. First, the following calculations are performed forall the elements E_(p)[i]:

1. If R_(p)[i]≧E_(p)[i+S_(p)] is satisfied, the following calculationsare performed:R_(p)[i]

R_(p)[i]−E_(p)[i+S_(p)]E_(p)[i+S_(p)]

0

2. If R_(p)[i]<E_(p)[i+S_(p)] and the following δR is positive, thefollowing calculations with regard to ρ⁻¹ through E_(p)[i+S_(p)] areperformed:δR

R_(p)[i−1]+R_(p)[i]+R_(p)[i+1]−E_(p)[i+S_(p)]ρ⁻¹

R_(p)[i+S_(p)−1]/(R_(p)[i+S_(p)−1]+R_(p)[i+S_(p)+1])ρ₊₁

R_(p)[i+S_(p)+1]/(R_(p)[i+S_(p)−1]+R_(p)[i+S_(p)+1])R_(p)[i]

0R_(p)[i−1]

δR·ρ⁻¹R_(p)[i+1]

δR·ρ₊₁E_(p)[i+S_(p)]

0

3. If R_(p)[i]<E_(p)[i+S_(p)] and δR is negative, the followingcalculations are performed:R_(p)[i−1]

0R_(p)[i]

0R_(p)[i+1]

0E_(p)[i+S_(p)]

−δR

After finishing the above calculations, the matching error value E_(pmD)in consideration of the deformation quantity is calculated by thefollowing equation:E _(pmD)=Σ_(i)(R _(p) [i]+E _(p) [i+S _(p)])

The results of the above calculations are shown in FIGS. 57B and 57C. InFIG. 57B, R_(p)[i] and E_(p)[i+S_(p)] are placed in a position suitablefor matching. On the other hand, in FIG. 57C, R_(p)[i] andE_(p)[i+S_(p)] are placed in a position displaced by 1 pixel from theposition suitable for matching. As shown in FIGS. 57B and 57C, thematching error value E_(pmD) in consideration of the deformationquantity is smaller than the simple matching error value E_(pmS) by thevalue that is created by correspondence in consideration of theallowable pattern deformation quantity. Therefore, the matching errorvalue E_(pmD) in consideration of the deformation quantity is suitablefor the matching error value E_(pm).

In the case where the allowable pattern deformation quantity is largerthan one pixel, the above calculations should be performed by using notonly R_(p)[i−1],R_(p)[i+1], but also R_(p)[i−2],R_(p)[i+2], and soforth.

The above matching error value E_(pmD) calculation is performed foredges and line segments in downward, rightward and leftward directionsalso. The line segments in another direction, for example, directions ofmultiples of 45 degrees, also can be used.

In this embodiment, edges in the opposite directions of 180 degrees, forexample, upward edge and downward edge, can be distinguished from eachother. However, in the case of using the above-mentioned 4.1.2 The firstedge detection method 2, the edges in the opposite directions of 180degrees cannot be distinguished. In this case, edges in the oppositedirections of 180 degrees are mingled and are calculated.

FIG. 46 shows the method in which the reference pattern is shiftedvertically and horizontally for every pixel, and position where theevaluation value F₀ becomes the maximum is taken as a matching position.However, according to this embodiment, the reference pattern is shiftedat sporadic pixel unit intervals, instead of shifting every pixel.Therefore, the calculation time is greatly shortened.

4.3 Matching Method in which Geometrical Information for IsolatedPattern is Used

The above matching method is suitable for a line-shaped pattern.However, an alternative method of performing matching for a hole patternand an island pattern, which are isolated patterns, can be used. A holepattern and an island pattern are rectangular patterns, and both thelonger side and the shorter side of each pattern are shorter than thewidth that is two to three times the minimum line width. A calculationtime for matching of a hole pattern and an island pattern is longer thana calculation time for matching of a line-shaped pattern because thehole pattern and the island pattern are smaller and more numerous thanthe line-shaped pattern. In order to solve this problem, the followinghigh-speed calculation method that requires less calculation time thanthe above-mentioned 4.2 Line-shaped pattern matching method can be used.

This method can be used for the case where all patterns to-be-inspectedcomprise hole patterns or island patterns. In addition, ordinarily ahole pattern and an island pattern don't exist simultaneously.Therefore, in this embodiment, a method in which every patternto-be-inspected is a hole pattern will be described. In the case of anisland pattern, matching method of a hole pattern can be used byreplacing hole with island.

In the first matching method of a hole pattern, geometrical informationobtained from edges of an image of a pattern to-be-inspected is used.FIGS. 58A, 58B and 58C are schematic views of the first matching methodof a hole pattern. FIG. 58A shows bold lines as edges of an image of apattern to-be-inspected, and solid circles (●) as centroids of theedges.

As the first step, edges are detected, and the minimum boundingrectangle and a centroid of the connecting edges are calculated as shownin FIG. 58A. In the case of an image having a contrast between theinside of the pattern and the ground, the edge detection as described in4.1.1 The first edge detection method 1 can be used.

In the case of an image having bright edges and having no contrastbetween the inside of the pattern and the ground, the edge detection asdescribed in the above-mentioned 4.1.2 The first edge detection method 2can be used. In this case, detected edges may not be necessarilyrecognized as connecting pixels. Therefore, detected edges are dilatedin order to be connected to each other, and are recognized as connectingpixels by the labeling processing. Then, the minimum bounding rectangleand the centroid of the edges are calculated as the minimum boundingrectangle and the centroid of those connecting pixels.

As the second step, the detected edges are selected by the followingprocedure using FIG. 58B:

1. The above-mentioned 3.3 Recipe data “7. The minimum size S_(hmin) andthe maximum size S_(hmax) of an isolated pattern, and the safety factorsk_(hmin) and k_(hmax)” are determined, and set beforehand.

2. If a size of the minimum bounding rectangle of the edges is greaterthan S_(hmin)×k_(hmax), the edges are not recognized as edges of a holepattern. The safety factor k_(hmax) is a value that is 1 to 2 and isempirically determined.

3. If a size of the minimum bounding rectangle of the edges is smallerthan S_(hmax)×k_(hmin), the edges are recognized as noise or dust, andare not recognized as edges of a hole pattern. The safety factork_(hmin) is a value that is 0.5 to 1 and is empirically determined.

4. If the detected edges don't form a ring-shape, the edges are notrecognized as edges of a hole pattern.

5. In the case of an image having a contrast between the inside of thepattern and the ground, it is possible to recognize whether the insideof the ring-shape of the above 4 is a hole or an island. If the insideof the ring-shape is not a hole, the edges are not recognized as edgesof a hole pattern.

In this embodiment, matching is performed by using an evaluation valueF_(h) instead of the evaluation values F₀, F_(a), and F_(b) used in theabove-mentioned 4.2 Line-shaped pattern matching method. The matching isperformed in the same manner as the above-mentioned Line-shaped patternmatching method except for using the evaluation value F_(h). In thisembodiment, reference patterns are obtained from the design data bysimple transformation. The evaluation value F_(h) is a summation ofvalues calculated from all the reference patterns, which are holepatterns, by the following procedure:

1. As shown in the first column of FIG. 58C, if there is no centroid ofthe edges in the reference pattern, the value is 0.

2. As shown in the second column of FIG. 58C, if there is a centroid ofthe edges in the reference pattern, the value is 1.

In order to use the above-mentioned 4.2.1 Matching method in whichunique pattern is used, and the above-mentioned 4.2.2 Matching method inwhich negative pattern is used described in the above-mentioned 4.2Line-shaped pattern matching method, the following two calculations areadded. The recognition of the unique pattern and negative pattern, andsetting of the degree of contribution to matching are the same as theabove-mentioned 4.2 Line-shaped pattern matching method.

3. If there is a centroid of the edges in the unique pattern, the valueis the above-mentioned degree of contribution to matching.

4. If there is a centroid of the edges in the negative pattern, thevalue is the above-mentioned degree of contribution to matchingmultiplied by (−1).

According to this embodiment, a matching method in which condensedinformation obtained from a plurality of edges is used can be realized.The method is performed at higher speed than a method in which edges areindividually used. Moreover, calculation cost is reduced greatly.

Further, high-speed calculation can be performed by using theabove-mentioned 4.2.3 Matching method in which projection data obtainedby projecting edge on the horizontal and vertical axes are used. In thiscase, projection data obtained by projecting the centroid of the edgesare used, instead of projection data obtained by projecting the edges.

4.4 Matching Method in which Statistic Values for Isolated Pattern areUsed

In the second matching method of a hole pattern, a statistic valuecalculated from part of the image of the pattern to-be-inspectedcorresponding to the inside of a reference pattern and a statistic valuecalculated from part of the image of the pattern to-be-inspectedcorresponding to the outside of the reference pattern are compared.FIGS. 59A, 59B, and 59C are schematic views of the second matchingmethod of a hole pattern. FIG. 59A shows reference patterns used in thisembodiment. These reference patterns are obtained by applying the sizeprocessing to design data. A dilating quantity of the size processing isless than half of the limit value of the positive side of theabove-mentioned 3.3 Recipe data “2. The allowable pattern deformationquantity of a diameter, in the case of an isolated pattern”. FIG. 59Bshows a typical image of a hole pattern to-be-inspected. Edges of thehole pattern are brighter than the ground, and the inside of the holepattern is darker than the ground.

In this embodiment, matching is performed by using an evaluation valueF_(d) instead of the evaluation values F₀, F_(a), and F_(b) used in theabove-mentioned 4.2 Line-shaped pattern matching method. The matching isperformed in the same manner as the Line-shaped pattern matching methodexcept for using the evaluation value F_(d). The evaluation value F_(d)is calculated from the following procedure:

1. As shown in FIG. 59C, a histogram H_(inside) is obtained from pixelsof the image of the hole pattern to-be-inspected corresponding to theinsides of all the reference patterns. The obtained histogram H_(inside)is standardized.

2. A histogram H_(outside) is obtained from pixels of the image of thehole pattern to-be-inspected corresponding to the outside of all thereference patterns. The obtained histogram H_(outside) is standardized.

3. Each element of a difference histogram H_(difference) is calculatedas a difference between an element of the histogram H_(inside) and anelement of the histogram H_(outside) that correspond to the element ofthe difference histogram H_(difference) respectively. The evaluationvalue F_(d) is calculated by summing absolute values of all the elementsof the difference histogram H_(difference).

In order to use the above-mentioned 4.2.1 Matching method in whichunique pattern is used, and the above-mentioned 4.2.2 Matching method inwhich negative pattern is used described in the above-mentioned 4.2Line-shaped pattern matching method, the following two calculations areadded. The recognition of the unique pattern and negative pattern, andsetting of the degree of contribution to matching are the same as theabove-mentioned 4.2 Line-shaped pattern matching method.

4. In the case of pixels of the image of the hole patternto-be-inspected corresponding to the inside of the unique pattern, eachof these pixels is converted into the number of the above-mentioneddegree of contribution to matching pixels, and the converted pixels areused for obtaining the histogram H_(inside).

5. In the case of pixels of the image of the hole patternto-be-inspected corresponding to the inside of the negative pattern,each of these pixels converted into the above-mentioned degree ofcontribution to matching multiplied by (−1) pixels, and the convertedpixels are used for obtaining the histogram H_(inside).

The above-mentioned step 5 means the following: If a hole exists in anegative pattern, the total number of the elements of the histogramH_(inside) decreases, however, a shape of histogram H_(inside) is notdeformed particularly. Therefore, in this case, the evaluation valueF_(d) is nearly equal to the evaluation value F_(d) that has beencalculated before calculation of this negative pattern. On the otherhand, if a hole does not exist in the negative pattern, the histogramH_(inside) becomes similar to the difference histogram H_(difference).The evaluation value F_(d) using the difference histogramH_(difference), which is used instead of the histogram H_(inside) madeby the above-mentioned procedure step 1, and the histogram H_(outside)is greater than the evaluation value F_(d) using the histogramH_(inside) and the histogram H_(outside). Therefore, in this case, theevaluation value F_(d) becomes greater than the evaluation value F_(d)that has been calculated before calculation of this negative pattern.

Image brightness distribution of ground of a hole pattern and an islandpattern may be non-uniform due to the electrification phenomenon and thelike. It means that the histogram H_(outside) may become spreading.However, by using this embodiment, the evaluation value F_(d) is notdrastically affected by spreading of the histogram H_(outside).

According to this embodiment, the difference histogram made fromhistograms with regard to the inside and outside of the hole pattern orthe island pattern is used as the evaluation value, and therefore thematching method which is robust against non-uniform image brightnessdistribution of the ground due to the electrification phenomenon and thelike can be realized. In addition, this method can also be used for theline-shaped pattern matching.

4.5 Post-Matching Processing

When the matching is performed and the shift quantity S₁=(x_(s),y_(s))at which the evaluation value takes the maximum is obtained, thereference pattern is shifted by the shift quantity S₁. The subsequentprocessing is performed while this shift is being maintained. The shiftquantity S₁ can be outputted to the display device 5 and the printer 6as the inspection result.

After the matching is completed, the edges of the image of the patternto-be-inspected are binarized. The binarization is performed by usingthe above-mentioned 3.3 Recipe data “3. The threshold used inbinarization of the edges of the image of the pattern to-be-inspected”.Specifically, if the magnitude of each edge of the image of the patternto-be-inspected is larger than the above-mentioned 3.3 Recipe data “3.The threshold used in binarization of the edges of the image of thepattern to-be-inspected”, the edge of the image of the patternto-be-inspected becomes an edge of the image of the patternto-be-inspected after binarization, otherwise the edge of the image ofthe pattern to-be-inspected does not become an edge of the image of thepattern to-be-inspected after binarization. In subsequent processing,the magnitude of each edge of the image of the pattern to-be-inspectedis not used.

As another binarization method, the p-tile method can be used. In thismethod, the number of the edges of the image of the patternto-be-inspected after binarization becomes the number of the edge of thereference pattern×p. Specifically, in the descending order, the numberof the edge of the reference pattern×p pieces of the edges of the imageof the pattern to-be-inspected becomes edges of the image of the patternto-be-inspected after binarization. The remainders do not become edgesof the image of the pattern to-be-inspected after binarization. Thecoefficient p is normally about 0.9 to 1.1, and is set as the parameterin the above-mentioned 3.3 Recipe data “3. The p-tile coefficient usedin binarization of the edges of the image of the patternto-be-inspected”, and is used.

4.6 The First Inspection

Next, the inspection unit 12 performs the first inspection.Specifically, calculation of a pattern deformation quantity, defectdetection, and recognition of a defect-class are performed. Theinspection unit 12 establishes a correspondence between the edge of theimage of the pattern to-be-inspected and the edge of the referencepattern (step S318). The position of edges is treated with sub pixelaccuracy. Therefore, the distance between the two edges can also beobtained with sub pixel accuracy. The direction of the edges isdetermined as a value in a range of 0 to 360 degrees with the rightdirection being set to 0 degree.

In this embodiment, the establishing of correspondence is performed inconsideration of a distance between the edge of the image of the patternto-be-inspected and the edge of the reference pattern, which is shiftedby the shift quantity S₁, and the directions of both the edges asdescribed in the following procedure:

For each edge of the reference pattern, the edge of the image of thepattern to-be-inspected located within the distance of theabove-mentioned 3.3 Recipe data “2. The limit values of the negativeside and the positive side of the allowable pattern deformationquantities” is searched. Then, a directional difference between eachdetected edge and the edge of the reference pattern is calculated. Ifthe directional difference is smaller than the above-mentioned 3.3Recipe data “2. The limit values of the allowable directional differencebetween edges”, the edge that is used in the calculation is recognizedas a corresponding edge within the allowable pattern deformationquantity. A vector d(x,y) between the two edges having thecorrespondence can be used to calculate the pattern deformationquantity. In addition, if a plurality of edges are recognized in theabove procedure, an edge whose distance is smallest and whosedirectional difference is smallest is adopted.

FIG. 60 is a diagram showing an example of the establishing ofcorrespondence between the edge of the image of the patternto-be-inspected and the edge of the reference pattern. In FIG. 60, eachedge is shown by an arrow to show its direction. In the example of FIG.60, the establishing of correspondence is performed for each pixel thatcontains the edge of the reference pattern by searching an edge of theimage of the pattern to-be-inspected in a direction perpendicular to theedge direction from the center of the edge of the reference pattern. Ifa distance between an edge of the image of the pattern to-be-inspectedand the center of the edge of the reference pattern is shorter than theallowable pattern deformation quantity, and a directional differencebetween those is smaller than the allowable directional differencebetween edges, those edges correspond. In FIG. 60, the vector d(x,y)between the two edges is an example of the above vector.

FIG. 61A is a diagram showing an example of the edge of the referencepattern, and FIG. 61B is a diagram showing an example of the edge of theimage of the pattern to-be-inspected corresponding to the referencepattern in FIG. 61A. The establishing of correspondence of both theedges will be described in FIGS. 61A and 61B. In this example, theallowable pattern deformation quantity is set to one pixel, and theallowable directional difference between edges is set to 60 degrees. Forexample, when an edge of the image of the pattern to-be-inspectedcorresponding to an edge 81 of the reference pattern is searched,because an edge 68 is located within the distance of the allowablepattern deformation quantity from the edge 81 and those directionaldifference is smaller than the allowable directional difference betweenedges, the edge 68 is recognized as the corresponding edge to the edge81. With regard to an edge 84 of the reference pattern also, an edge 70is recognized as the corresponding edge of the image of the patternto-be-inspected.

With regard to an edge 82 of the reference pattern, an edge 61 is notlocated within the distance of the allowable pattern deformationquantity. An edge 64 is not located within the distance of the allowablepattern deformation quantity, and a directional difference is largerthan the allowable directional difference between edges. Although edges66 and 69 exist within the distance of the allowable pattern deformationquantity, those directional differences are not smaller than theallowable directional difference between edges. Therefore, an edgecorresponding to the edge 82 cannot be obtained. Similarly, an edgecorresponding to an edge 83 cannot be obtained.

In addition, FIGS. 61A and 61B show a method in which the inside and theoutside of a pattern are not distinguished and the direction has a valueonly in a range of 0 to 180 degrees. However, a method in which theinside and the outside of the pattern are distinguished can be used. Forexample, if the edge direction is determined so that the inside of thepattern is always located on the right-hand side of the edge, the edgesof reference pattern in FIG. 61A become the state shown in FIG. 62.Therefore, the establishing of correspondence can be executed moreexactly.

Next, the inspection unit 12 performs defect detection (step S320). Inorder to detect a defect, the following two methods are used.

4.6.1 Method of Recognizing Defect Having Abnormal Pattern DeformationQuantity

As the first defect detection method, a defect having abnormal patterndeformation quantity is recognized by the following procedure: FIGS. 63Aand 63B are schematic views showing a method of recognizing a defecthaving abnoinial pattern deformation quantity. The inspection unit 12recognizes edges of the image of the pattern to-be-inspected that do notcorrespond to edges of the reference pattern (for example, the edges 61to 67, the edge 69, and the edge 75 of FIG. 61B) as defect pixels. Abinary bitmap that represents the above defect pixels is obtained.

Next, the obtained binary bitmap is dilated in order to connect defectpixels each other by a dilation width W_(dilation) (in this figure, thedilation width W_(dilation) is two pixels) as shown in FIG. 63A. Thedilated binary bitmap is obtained as the result of the dilationoperation on the binary bitmap. The dilation operation is a well-knownoperation used in the mathematical morphology.

As shown in FIG. 63B, when a defect is detected, the defect may bedetected in such a state that the defect is divided into a plurality ofparts due to noise and the like. In this case, the divided parts aremerged by using the dilation width W_(dilation), which is empiricallydetermined, and an area including the merged parts is recognized as asingle defect.

The dilation operation and the erosion operation that are well known inthe mathematical morphology will be described. The dilation operation δand the erosion operation c are operations that make the followingresults of calculation:

${\delta_{B}(A)} = {\bigcup\limits_{b \in B}(A)_{- b}}$${ɛ_{B}(A)} = {\bigcap\limits_{b \in B}(A)_{- b}}$

In these equations, ‘A’ is a target image (binary bitmap), and ‘B’ is astructure element (binary bitmap). ‘(A)_(−b)’ means translation of ‘A’by ‘−b’. The symbols ∪, ∩ mean summation operation OR, and productoperation AND of binary bitmaps for each b which satisfies bεB.

Next, the pixels that connect with each other are recognized as one areaby the labeling processing. The labeling processing is defined as amethod in which a group of connected pixels is formed by writing thesame value on the pixels that are being connected at four neighborhoodsor eight neighborhoods thereof. By giving different values to groups ofconnected pixels that are not connected each other, each group ofconnected pixels can be distinguished. When the group of the connectedpixels is recognized as an area containing a defect, the minimumbounding rectangle of the defect is obtained. The minimum boundingrectangle of the defect is defined as a minimum rectangle containing thegroup of connected pixels.

The above procedure is performed as shown in FIG. 63B. In FIG. 63B,there are discontinuous defects corresponding to a line segmentextending in the lower right direction of a reference pattern. Thesedefects are to be a single defect inherently, but appear in a dividedstate. First, areas that have been recognized as the defects areobtained as a binary image (shown by black pixels). This binary image isdilated by the dilation width W_(dilation) so that a region shown bywhite pixels is created. Next, the black pixels and the white pixels arerecognized as an area by the labeling process, and the minimum rectangleincluding the obtained recognized area is obtained as the minimumbounding rectangle.

Finally, a center of the minimum bounding rectangle and a size of theminimum bounding rectangle are calculated to obtain a defect locationand a defect size. The obtained defect location and the defect size aretaken as defect information.

4.6.2 Method of Recognizing Defect Using Luminance Distribution ofPixels

As the second defect detection method, a defect is recognized by thefollowing procedure using luminance distribution of pixels. First, aregion is obtained by connecting edges of an image of a patternto-be-inspected that correspond to a reference pattern. Luminancedistribution of pixels existing in the inside of the region andluminance distribution of pixels existing in the outside of the regionare obtained. If there is no defect, these luminance distributionsshould be normal distributions. Therefore, pixels having luminancevalues that are out of the normal distribution are recognized as defectpixels.

Pixels having luminance values that are out of the normal distributionare obtained, and are recognized as an area by the labeling process, andthe minimum rectangle including the recognized area is obtained as theminimum bounding rectangle. Finally, a center of the minimum boundingrectangle and a size of the minimum bounding rectangle are calculated toobtain a defect location and a defect size. The obtained defect locationand the defect size are taken as defect information.

FIG. 64 is a schematic view showing a method of recognizing a defectusing luminance distribution of pixels. A broken line 201 shows edges ofan image of a pattern to-be-inspected. Solid lines 202, 203 on bothsides of the broken line 201 are boundaries of a region formed bydilating the edges by a predetermined width, and a part surrounded bythe solid lines 202, 203 is determined as an edge area. Luminance valuesof the ground 204 and the inside 205 of the pattern to-be-inspectedroughly constitute the normal distribution.

As shown in FIG. 65, parts D, which are located beyond the ±3σ region ofluminance distribution, are very likely to be a defect. Although theparts D also contain a noise, the noise exists in the area in arelatively uniform manner. On the other hand, the defect exists as beingclustered. A binarized map in which any pixel having a luminance valuecorresponding to the parts D is binarized to unity, i.e. (1), and apixel having other luminance value is binarized to zero is created. Theclustered pixels having a luminance value of unity (1) whose size is notmore than a specified size (for example, 2×2 pixels) are erased (forexample, the clustered pixels 207 of FIG. 64 being erased). For thiscalculation, the median filter or the like can be used. A window size ofthese filters should be empirically determined in consideration of asize of a defect that should be detected. The clustered pixels having aluminance value of unity (for example, the clustered pixels 206 in FIG.64) are recognized as a defect.

The above-mentioned 4.6.1 Method of recognizing defect having abnormalpattern deformation quantity detects a defect existing near the edge ofthe reference pattern. On the other hand, this method of recognizing adefect using luminance distribution of pixels detects a defect exitingin parts except for the neighborhood of the edges of the referencepattern.

When the defect is detected, defect information (the defect position,the defect size, and the image including the defect) is outputted to thedefect-class determination unit 14 (steps S322, S324).

4.7 Method of Determining Defect-Classes Based on Feature QuantityObtained from Image

The defect-class determination unit 14 determines a defect-class usingthe defect information and information of the defect-class referencedatabase 23 (step S326). Specifically, feature quantities are obtainedfrom part of an image of a pattern to-be-inspected corresponding to adefect and are compared with other feature quantities to recognize thedefect-class. The other feature quantities are obtained from parts ofimages of patterns to-be-inspected corresponding to other defects, andstored in the defect-class reference database 23. The defect-classdetermination unit 14 outputs the defect information (the defectposition, the defect size, and the image including the defect) and thedefect-class to the display device 5 and the printer 6 through theoutput unit 13 (step S328). The defect-class reference database 23 is adatabase in which the already acquired images have been registered forrespective defect-classes.

The defect-class determination unit 14 determines the defect-classes inthe following procedure:

Geometrical information, which is a kind of a feature quantity, ofconnected pixels determined as defects is obtained. By using thegeometrical information, a shape feature such as being circular, beingelongated, and the like can be recognized, and if the shape is circular,the defect is recognized as an alien substance, or the like. If theshape is elongated, the defect is recognized as a scratch, or the like.The pixels recognized as defects are classified into three parts: pixelinside the pattern to-be-inspected; pixel outside the patternto-be-inspected; and pixel on the boundary. For each part, the featurequantities of the pixels are obtained by using the pixel luminancevalues of the image of the pattern to-be-inspected. If the pixel isrecognized as an alien substance, whether the alien substance is a metalpiece or organic material (for example, human dirt) or the like can berecognized. Specifically, if the alien substance is a metal, it looksbright; and if it is the organic material, it looks dark.

Further, in the case where the alien substance exists in the inside ofthe pattern to-be-inspected, when the pixels recognized as the aliensubstance show a large variation in the luminance, it is recognized thatthe alien substance is likely to exist on the pattern to-be-inspected;when such pixels show a small variation in the luminance, it isrecognized that the alien substance is likely to exist beneath thepattern to-be-inspected. This is difficult processing for theconventional die-to-die method, because whether the defect is in theinside of the pattern to-be-inspected or the outside of the patternto-be-inspected is difficult to determine only by using the image of thepattern to-be-inspected. The present method uses these featurequantities to determine the defect-class by a well-known classificationmethod. As the classification method, the k nearest neighbor method canbe used.

The above method of determining the defect-class is a method based on aconventional optical method, namely, the ADC (Automatic DefectClassification) of the SEM method. According to this embodiment, theinside and the outside of the pattern to-be-inspected can be clearlyrecognized by using the design data. Therefore, the feature quantitiesfor each part are obtained correctly, and accuracy of the classificationis improved.

4.8 Pattern Deformation Quantities Obtained from the WholeInspection-Unit-Area

Next, the inspection unit 12 obtains pattern deformation quantities fromrelation between the edge of the image of the pattern to-be-inspectedand the edge of the reference pattern that correspond (step S330). Thepattern deformation quantities are obtained from part where a defect isnot detected. Then, the pattern deformation quantities are outputted tothe display device 5 and the printer 6 through the output unit 13 (stepS332).

Two kinds of pattern deformation quantities are used. One is patterndeformation quantities obtained from the whole inspection-unit-area, andthe other is pattern deformation quantities obtained for each attributeof the reference pattern. As the pattern deformation quantities obtainedfrom the whole inspection-unit-area, an edge placement error, amagnification variation quantity, and a deformation quantity of the linewidth can be used.

The edge placement error can be calculated as an average value of thevectors d(x,y) between the two edges that correspond. The edge placementerror becomes the shift quantity S₂ with sub pixel accuracy. The shiftquantity S₂ to which the shift quantity S₁ is added, which was describedin the above-mentioned 4.5 Post-matching processing, becomes a shiftquantity with sub pixel accuracy. If the error of the XY stage 321 canbe neglected, a value of the shift quantity S₁+S₂ becomes an edgeplacement error of pattern to-be-inspected in each inspection-unit-area.

If the error of the XY stage 321 cannot be neglected and inspection isperformed with sub pixel accuracy, the value of the shift quantity S₁+S₂is substituted for the shift quantity S₁, and the reference pattern isshifted by the shift quantity S₁, and then steps S318 through S330 areperformed again.

In order to calculate a magnification variation quantity in theX-direction, X-components of the vectors d(x,y) with regard to a linesegment of a reference pattern in the vertical direction areapproximated by a regression line, and a regression line D(x) isobtained. Then, a gradient of the regression line is taken as themagnification variation quantity in the X-direction. The procedure isthe same for the magnification variation quantity in the Y-direction.

FIG. 66A is a diagram showing an example of edges of the referencepattern (broken lines) and edges of the image of the patternto-be-inspected (solid lines), and FIG. 66B is a diagram showing anexample in which the X-components of the vectors d(x,y₀) between twoedges at y=y₀ shown in FIG. 66A are approximated by the regression lineD(x). When the X-components of the vectors d(x,y₀) are approximated bythe regression line D(x)=ax+b, the gradient ‘a’ corresponds to themagnification variation quantity. In the example of FIG. 66A, it isrecognized that the patterns to-be-inspected are larger than thereference pattern as a whole.

FIG. 67A is a diagram showing another example of the edges of thereference pattern (broken lines) and the edges of the image of thepattern to-be-inspected (solid lines), and FIG. 67B is a diagram showingan example in which the X-components of the vectors d(x,y₀) between thetwo edges at y=y₀ shown in FIG. 67A are approximated by the regressionline D(x). In the example of FIG. 67A, in addition to patterns in theimage of the pattern to-be-inspected being larger than the referencepattern as a whole, line widths are dilated. In FIG. 67A, line-shapedpatters 121, 122, and 123 of the reference pattern correspond toline-shaped patterns 124, 125, and 126 of the image of the patternto-be-inspected, respectively.

The deformation quantity of the line width in the X-direction can beobtained, for example, by calculating the average value ofsign(x,y₀)·{X-component of d(x,y₀)−D(x)}, where sign (x,y₀) takes avalue of −1 when (x,y₀) is positioned on the left side of the line, andtakes a value of +1 when (x,y₀) is positioned on the right side of theline. In addition, if the standard deviation of sign(x,y₀)·{X-componentof d(x,y₀)−D(x)} is calculated with regard to the deformation quantityof the line width, the standard deviation of the line widths can beobtained.

4.9 Extraction Rules for Attributes of Reference Pattern

Examples of the above-mentioned 3.3 Recipe data “4. The parameters usedin the extraction rules for determining attributes of the referencepattern” will be described by using FIG. 68. The line part 171 isextracted as a line segment having a length longer than a predeterminedlength L. The corner 172 is extracted as a portion positioned in theneighborhood of connecting points where two line parts connect with eachother at a predetermined angle (90 degrees, 135 degree, 270 degrees, andthe like). The end 173 is extracted as a line segment having a lengthequal to or shorter than a predetermined length L and having bothterminations 173 t, 173 t which contact the line parts 171, 171 at anangle of 90 degrees. The end 173 and the two line parts 171, 171 form aU shape. The isolated pattern is extracted as a closed figure having anarea equal to or smaller than a predetermined area.

4.10 Method of Detecting Defect Using Attributes of Reference Pattern

As attributes of reference pattern, a line part 171, a corner 172, anend 173, an isolated pattern 174, and the like are used as shown in FIG.68. The attributes of reference pattern are automatically added to thereference pattern and used at the time of inspection.

As the pattern deformation quantities with regard to the attributes ofreference pattern, the followings can be used: the edge placement error,the magnification variation quantity, and the deformation quantity ofthe line width, which were described in the above-mentioned 4.8 Patterndeformation quantities obtained from the whole inspection-unit-area; inaddition, deformation quantities of feature quantities such as adiameter, an area, a length of periphery, a circularity, a moment, and aradius of curvature.

4.10.1 Defect of End Having Edge Placement Error

FIGS. 69A and 69B are diagrams showing an edge placement error of anend. As shown in FIG. 69A, the edge placement error of the end is theminimum distance between edges 164, which constitute the end of thereference pattern, and edges 163 of the image of the patternto-be-inspected.

As an alternative method, as shown in FIG. 69B, an average value, themaximum value, the minimum value, the median, or the like of distancescorresponding to a section 157 having an arbitrary length may be used asthe edge placement error of the end.

If the edge placement error is not within the allowable edge placementerror of an end in the above-mentioned 3.3 Recipe data “2. The limitvalues of the negative side and the positive side of the allowablepattern deformation quantities”, it is recognized that the end has adefect.

4.10.2 Defects of Line Part and Corner Having Edge Placement Error

In FIGS. 69A and 69B, the edge placement error of the end has beendescribed. In addition, with regard to a line part and a corner, theedge placement error can be calculated in the same manner. With regardto the line part, the edge placement error corresponding to the linepart is calculated and a defect is detected. With regard to the corner,the edge placement error corresponding to direction at an angle of halfof the corner's angle or a specified angle is calculated and a defect isdetected.

In these cases, instead of the allowable edge placement error of anedge, the allowable edge placement error of a line part and a corner areused, respectively.

4.10.3 Defects of Isolated Pattern Having Placement Error

FIG. 70 is a diagram showing a placement error of an isolated pattern. Aplacement error is defined as a distance between a centroid 162 of edges160 of a reference pattern (which forms an isolated pattern) and acentroid 161 of edges 159 of an image of a pattern to-be-inspected(which forms the isolated pattern).

If the placement error is not within the allowable placement error of anisolated pattern in the above-mentioned 3.3 Recipe data “2. The limitvalues of the negative side and the positive side of the allowablepattern deformation quantities”, it is recognized that the isolatedpattern has a defect.

4.10.4 Other Defects of Isolated Pattern

Moreover, deformation quantities of feature quantities of the isolatedpattern can be inspected. As the feature quantities, a diameter, anarea, a length of periphery, the degree of circularity, a moment, andthe like can be used. As shown in FIG. 70, the above-mentioned featurequantities of the edges 160 of the reference pattern and the edges 159of the image of the pattern to-be-inspected are calculated, and thendifferences between feature quantities of both are inspected to detect adefect.

4.10.5 Defect of Corner Having Abnormal Curvature

FIG. 71A is a diagram showing an example of edges of a corner of areference pattern, and FIG. 71B is a diagram showing an example of edgesof a corner of an image of a pattern to-be-inspected. An edge 166 of thecorner of the reference pattern shown in FIG. 71A has been rounded offwith a radius R₁. As a curvature of an edge 165 of the image of thepattern to-be-inspected, a radius R₂ of a circle that is approximated bya circle by using the least square method is obtained. Instead of theradius R₂, a major axis or minor axis of an ellipse that is approximatedby an ellipse by the least square method may be used. A differencebetween the radius R₁ and the radius R₂ is inspected to detect a defect.

The above inspection methods are performed simultaneously for aplurality of positions within the field of view. The inspection itemsare selected according to the above-mentioned 3.3 Recipe data “1. Thepattern deformation quantities to be inspected”.

4.11 The Second Edge Detection

The inspection unit 12 detects the edge (the second edge) again from theimage of the pattern to-be-inspected (step S334). The second edge isdetected from a profile obtained from the image of the patternto-be-inspected. As the second reference pattern, a reference patternwhose edge is a point Q in FIG. 76 is used. On the contrary, in the caseof the image having bright edges and having no contrast between theinside of the pattern and the ground, as described in 4.1.2 The firstedge detection method 2, as the first reference pattern, a referencepattern whose edge is a point P in FIG. 76 is used. Therefore, thesecond reference pattern generally differs from the first referencepattern.

Before detecting the second edge of the image of the patternto-be-inspected, the second reference pattern is shifted by theabove-mentioned shift quantity of S₁+S₂. Any subsequent processing isperformed with the shift quantity keeping.

In order to detect an edge position from the profile, various methods(for example the threshold method, the linear approximation method, andthe like) have been disclosed. In this embodiment, the threshold methodis used and measurement of a line width that is performed in a CD-SEM isapplied to an image of a two-dimensional pattern (an image of a patternto-be-inspected). However, if the threshold method is replaced withother methods such as the linear approximation method, the processingcan be made similarly. The linear approximation method is a method inwhich the profile is approximated by lines and an intersection is usedto detect the edge.

FIG. 72 is a diagram showing an example of profile acquisition sections.As shown in FIG. 72, the profile acquisition sections are perpendicularto edges of the second reference pattern, and the edges of the secondreference pattern are center points of the profile acquisition section(double lines in FIG. 72). A length of the profile acquisition sectionis the above-mentioned 3.3 Recipe data “6. The length of a profileacquisition section”, and an interval between the profile acquisitionsections is the above-mentioned 3.3 Recipe data “6. The interval betweenprofile acquisition sections”.

In addition, instead of the above-mentioned second reference pattern, asshown in FIG. 73, a contour of an exposed pattern obtained by alithography simulator (solid lines in FIG. 73) can be used.

Profile data is obtained from a section of the image of the patternto-be-inspected corresponding to the profile acquisition section forevery interval, which is the above-mentioned 3.3 Recipe data “6. Theinterval between sampling points in a profile acquisition section”. Thelength of the profile acquisition section is set to an arbitrary lengthlonger than the allowable pattern deformation quantity. The intervalbetween sampling points is set to an arbitrary value equal to or smallerthan the interval of pixels. For obtaining profile data, the bilinearinterpolation, the spline interpolation, or the Fourier series is used.

FIG. 74 is an enlarged diagram of a part of FIG. 72 (portion B) and FIG.75 is an enlarged diagram of a part of FIG. 74 (portion C). A doubleline in FIG. 74 or FIG. 75 is the same profile acquisition section inFIG. 72. In FIG. 75, intersections of a grid represent positions ofpixels, and solid circles on the profile acquisition section representpositions where luminance values of the profile acquisition section areobtained.

The bilinear interpolation method is a method in which a luminance valueI(x,y) at a position (x,y) (0<x≦1, 0<y≦1) is calculated by the followingequation using luminance values I(0,0), I(0,1), I(1,0), and I(1,1) ofpixels shown by (0,0), (0,1), (1,0), and (1,1).I(x,y)={I(0,0)(1−x)+I(1,0)x}(1−y)+{I(0,1)(1−x)+I(1,1)x}y

From the profile obtained by using this equation, the second edgeposition is detected by using the threshold method. As shown in FIG. 76,the maximum luminance value V and its position P in the profile areobtained. The maximum luminance value V is multiplied by a previouslyspecified coefficient k to obtain a threshold T, and intersections of aline whose luminance value is equal to the threshold T and the profilecurve are obtained. From these intersections, an intersection Q, whichis located in an outward direction of the pattern to-be-inspected fromthe point P and is closest to the point P, is obtained. By calculatingthe intersections Q from all profiles, the second edges are detected.

A cross section of a pattern to-be-inspected formed on a wafer has atrapezoidal shape. By using the coefficient k, it can be set whethermeasurement is performed at the upper level, the lower level, or themiddle level.

For example, in the case of using the coefficient k equal to 0.5, thedetected edge exists in a position shifted from an ideal position by ahalf of an electron beam spot size in the outer direction of the patternto-be-inspected. The electron beam spot size is defined as a width of asection, in which luminance values are more than a half of the maximumluminance value.

After the second edges are detected, the detected second edges areapproximated by curves (including the polygon approximation) to connectthe detected second edges. The simplest method is to connect thedetected second edges by segment lines (polygonal lines). For example,in the case of using the split-and-merge method disclosed in thefollowing, the detected second edges are smoothly connected by polygonapproximation using the least square method. T. Pavlidis and S. L.Horowitz, “Segmentation of plane curves,” IEEE Trans. on Computers, Vol.C-23, No. 8, Aug., 1974. FIG. 77A is a diagram showing examples of theabove method.

As an alternative method, a curve approximation of plane data by atwo-dimensional spline function using the least square method, as shownin FIG. 77B, can also be used. The former can be processed at highspeed, but has little flexibility for a curve containing many roundedparts. On the other hand, the latter can be processed at high speed andcan be flexible. Besides the above methods, various methods such as amethod in which the Fourier descriptor is used have been disclosed andone of these can be substituted for the above methods.

In addition, the above curve approximation may be performed afterdetecting the first edges.

As methods of setting the profile acquisition sections, the followingtwo methods can be used. One is the above-mentioned method in whichdirections and positions for acquiring the profiles are set beforehandby using the second reference pattern. This method is used for the casewhere the above-mentioned 3.3 Recipe data “6. The flag for indicatingwhether profile acquisition sections are set at the time of settingrecipe data, or are set after detecting the first edges” is “at the timeof settling recipe data”. In this method, the profile acquisitionsections are set uniquely by using the second reference pattern.

As an alternative method of setting the profile acquisition sections, amethod in which the profile acquisition sections are adaptively setafter detecting the first edges can be used. This method is used for thecase where the above-mentioned 3.3 Recipe data “6. The flag forindicating whether profile acquisition sections are set at the time ofsetting recipe data, or are set after detecting the first edges” is“after detecting the first edges”.

Specifically, as shown in FIG. 78A, in this method, profile acquisitionsections are set in a direction perpendicular to the detected firstedges of the image of the pattern to-be-inspected. According to thismethod, as shown in FIG. 78B, even if the detected first edges (solidlines) of the image of the pattern to-be-inspected are displaced fromthe above-mentioned second reference pattern (dotted lines), the profileacquisition sections can be shorter than the above-mentioned method.Further, this method can easily follow pattern deformation compared tothe above-mentioned method. After the profile acquisition sections areset, the same processing as the above-mentioned method is performed.

4.12 The Second Inspection

After the second edge detection, the inspection unit 12 performs thesecond inspection (step S336). This inspection (step S336) is the sameprocessing as the steps S320 through S332 in the above-mentioned 4.6 Thefirst inspection except for using the second edge instead of the firstedge. In step S318, the inspection unit 12 establishes thecorrespondence between the edge of the image of the patternto-be-inspected and the edge of the reference pattern; however, in thesecond inspection, the correspondence is established by the profileacquisition sections.

The second inspection performs the defect detection, and then obtainsthe pattern deformation quantity. The shift quantity S₃ with regard tothe whole image corresponds to the quantity S₂ as described in theabove-mentioned 4.8 Pattern deformation quantities obtained from thewhole inspection-unit-area. The obtained quantity S₃ plus the aboveshift quantity S₁ and S₂ becomes the total shift quantity between thesecond reference pattern and the patterns in the image of the patternto-be-inspected.

In the second inspection, the above-mentioned 4.6.1 Method ofrecognizing defect having abnormal pattern deformation quantity and theabove-mentioned 4.6.2 Method of recognizing defect using luminancedistribution of pixels are altered.

In the above-mentioned 4.6.1 Method of recognizing defect havingabnormal pattern deformation quantity of the first inspection, the edgesof the image of the pattern to-be-inspected that do not correspond tothe edges of the reference pattern are recognized as the defect pixels.However, in the second inspection, the profile acquisition sectionswhich do not have edges within the above-mentioned 3.3 Recipe data “2.The limit values of the negative side and the positive side of theallowable pattern deformation quantities” are recognized as a defect.

In the above-mentioned 4.6.2 Method of recognizing defect usingluminance distribution of pixels of the above-mentioned firstinspection, the region is obtained by connecting the edges of the imageof the pattern to-be-inspected that correspond to the reference pattern.However, in second inspection, a region is obtained by connecting theedges of the reference pattern.

If the above basic inspection processing has been performed for all theinspection-unit-areas, the inspection processing is terminated;otherwise the flow goes back to step S308 (step S340).

5. Application Inspection Processing

The foregoing is the basic inspection processing according to the flowchart shown in FIG. 25. In this chapter, application processing expandedbased on the basic inspection processing will be described.

5.1 Method of Recognizing Repeated Defects

As described in the above-mentioned 4. Basic Inspection processing, theexample of inspection processing for recognizing repeated defects isdescribed in FIG. 27. The inspection processing is an expanded processof the inspection processing according to the flow chart shown in FIG.25.

5.1.1 The First Method of Recognizing Repeated Defects

As the first method of recognizing repeated defects, the followingprocedures are performed:

First, the block A of the preparation process before inspection isperformed. Next, defects are detected by the block B of the inspectionprocess for an inspection area in each semiconductor device, and thenthe detected defects are merged (step S402). The block A and the block Bof FIG. 27 are identical to the block A and the block B of FIG. 26,respectively. The steps S302 to 5306 in the block A are identical to thesteps S302 to S306 of FIG. 25. Further, the steps S308 to S336 in theblock B are identical to the steps S308 to 5336 of FIG. 25.

In the block B, after the step S336, the step S338 for outputting thedefect information to the defect information storage unit 24 is added.Addition of step S338 is different from FIG. 25. The step S340 in theblock B is identical to the step S340 of FIG. 25. Theinspection-unit-areas in the step S340 are obtained by dividing theinspection area represented by the coordinate system used in the designdata, and the inspection-unit-areas in each semiconductor device areinspected.

In the case where the inspection area larger than theinspection-unit-area shown in FIG. 23 is inspected, a defect existing ina plurality of the inspection-unit-areas may be detected in such a statethat the defect is divided into a plurality of portions. By mergingthese divided portions of the defect, division of the defect by theboundaries between the inspection-unit-areas can be eliminated.

FIG. 79 is a schematic view showing an example in which an inspectionarea is divided into four inspection-unit-areas. A defect A lies acrossan inspection-unit-area on the upper right side and aninspection-unit-area on the lower right side. First, the minimumbounding rectangle 31 of a part of the defect A located in theinspection-unit-area on the upper right side and the minimum boundingrectangle 32 of a part of the defect A located in theinspection-unit-area on the lower right side are obtained. The minimumbounding rectangle 31 and the minimum bounding rectangle 32 are obtainedby the procedure shown in FIG. 63B.

Next, overlapping check of the minimum bounding rectangles included inall of the inspection-unit-areas that constitute the inspection area isperformed. If the minimum bounding rectangles overlap, the minimumbounding rectangle including all the overlapped minimum boundingrectangles is taken as the merged minimum bounding rectangle. In thisexample, the minimum bounding rectangle M is obtained as the mergedminimum bounding rectangle from the minimum bounding rectangle 31 andthe minimum bounding rectangle 32. In FIG. 79, although the minimumbounding rectangle M (shown by dotted line), the minimum boundingrectangle 31, and the minimum bounding rectangle 32 should be overlappedpartially, the minimum bounding rectangle M is drawn slightly larger forsimple drawing.

Similarly, the defect B lying across four inspection-unit-areas may bemerged. In this case, the four minimum bounding rectangles are merged asa single minimum bounding rectangle (step S402). The defect informationexisting in the obtained minimum bounding rectangle is merged, and themerged defect information is stored in the defect information storageunit 24 (step S403).

After checking whether all the inspection of the semiconductor deviceto-be-inspected has been completed (step S404), if it is judged that allthe inspection has been completed, repeated defects are recognized (stepS406). The defect information obtained from the same inspection areas ineach semiconductor device, which has been fabricated based on the samedesign data, and is represented in a coordinate system used in thedesign data. The defect information is stored in the defect informationstorage unit 24 by step S338.

FIG. 80 is a schematic view showing defect information obtained from thefirst semiconductor device and defect information obtained from thesecond semiconductor device. When the defect information obtained fromthe first semiconductor device and the defect information obtained fromthe second semiconductor device are superimposed, it is recognized thatthe minimum bounding rectangle 33A and the minimum bounding rectangle33B overlap with the minimum bounding rectangle 34. This processing iswell known as processing of the Boolean operation. The common minimumbounding rectangle 35 is obtained as the minimum bounding rectangleincluding these three minimum bounding rectangles. Defects, which arenot shown in the figure, in the common minimum bounding rectangle 35 arerecognized as defects that exist commonly in a plurality ofsemiconductor devices, i.e. repeated defects.

This means that there exist the repeated defects in the common minimumbounding rectangle 35, the defects have been detected as the dividedminimum bounding rectangle 33A and the minimum bounding rectangle 33Bdue to noise or the like in the first semiconductor device, and thedefect has been detected as the single minimum bounding rectangle 34 inthe second semiconductor device. The shift of the minimum boundingrectangle 33A and the minimum bounding rectangle 33B from the minimumbounding rectangle 34 means that the defects have been detected at aslightly different position.

The above processing can be performed in the case of using defectinformation that has been obtained from N semiconductor devicesincluding at least three semiconductor devices. In this case, when theminimum bounding rectangles obtained from semiconductor devices of notless than M overlap each other, repeated defects are recognized. Thenumber M is in the range of two to N. The larger M is, the moreaccurately the repeated defects can be obtained.

The defect information of the repeated defects detected by the aboveinspection is outputted to the defect information storage unit 24 (stepS408). The defect information in the defect information storage unit 24is outputted to the display device 5 and the printer 6 through theoutput unit 13 (step S410).

According to this embodiment, huge labor of an operator is madeunnecessary, and the defect recognition inaccuracy caused by anoperator's mistake can be prevented. In addition, even if a specimen iscontaminated, contaminations are not detected as repeated defects,because the contaminations seldom or never exist at the same location ofdifferent devices.

5.1.2 The Second Method of Recognizing Repeated Defects

As the second method of recognizing repeated defects, defect informationis obtained from the entire inspection area in at least one ofsemiconductor devices, and then defect information is obtained byinspecting an area of another semiconductor device corresponding to thedefect locations in the defect information obtained from the aboveinspected semiconductor device and its neighborhood. Then, repeateddefects are recognized.

In this embodiment, a method in which defect information is obtainedfrom the entire inspection area in the first semiconductor device, andthen defect information is obtained by inspecting an area of the secondsemiconductor device corresponding to the defect locations in the defectinformation obtained from the first semiconductor device and itsneighborhood will be described.

As the first step, with regard to the first semiconductor device, theblock A, the block B, the step S402, and the step S403 are performed. Onthe left-hand side of FIG. 81, defect information of the firstsemiconductor device obtained from the step S403 is shown schematically.An image of a pattern to-be-inspected corresponding to the minimumbounding rectangle 41 obtained from the first semiconductor device andits neighborhood is acquired from the second semiconductor device, andthe defect is inspected from the image. On the right-hand side of FIG.81, defect information in limited areas is shown schematically as defectinformation obtained from the second semiconductor device.

As the second step, the defect information obtained from the firstsemiconductor device and the defect information from the secondsemiconductor device are superimposed. In FIG. 81, the minimum boundingrectangle 41 overlaps with the minimum bounding rectangle 42A and theminimum bounding rectangle 42B. Next, the minimum bounding rectangleincluding these three minimum bounding rectangles is obtained as thecommon minimum bounding rectangle 43. Defects, which are not shown inthe figure, in the common minimum bounding rectangle 43 are recognizedas defects that exist commonly in both semiconductor devices, i.e.repeated defects. The same processing is performed on the minimumbounding rectangle 51.

In this embodiment, the second semiconductor device is inspected in thelimited areas with regard to all the defects included in the defectinformation that have been obtained from the first semiconductor device.In the case where the number of the defects included in the defectinformation that has been obtained from the first semiconductor deviceis small, this method is performed faster than the above-mentioned.5.1.1 The first method of recognizing repeated defects.

5.1.3 The Third Method of Recognizing Repeated Defects

As the third method of recognizing repeated defects, a method in whichdefect information is obtained from the entire inspection area of onesemiconductor device, and repeated defects caused by an OPC pattern isrecognized can be used. This method can be used in the case wherereference patterns, which are related to mask data having the same OPCpattern, are classified by using a cell name of design data.

For example, in FIG. 82, a pattern having a cell name CellA of designdata and a pattern having a cell name CellB of the design data are thesame; however, these patterns have different OPC patterns. In this case,it is necessary for these patterns of the design data to have differentcell names. In the case where these patterns of the design data have thesame cell name, combination of the cell name and line segment numbers ofthe cells used in defect detection is used. In this case, the referencepatterns may not be classified strictly. The cell name of the designdata means one of native geometric information of the design data. Asanother native geometric information of the design data, a cell name ofmask data corresponding to the design data can be used.

In this embodiment, as the first step, with regard to one semiconductordevice, the block A, the block B, the step S402, and the step S403 areperformed. On the left-hand side of FIG. 81, defect information of thesemiconductor device obtained from the step S403 is shown schematically.A cell name of the design data corresponding to the minimum boundingrectangle 41 obtained from the semiconductor device is obtained. Thesame processing is performed on the minimum bounding rectangle 51.

As the second step, the defect information is classified by the obtainedcell names. If the number of defects belonging to the same cell name ismore than one, the defects are recognized as repeated defects caused byan OPC pattern; otherwise, whether the defects are repeated defects isrecognized by the above-mentioned 5.1.2 The second method of recognizingrepeated defect.

According to this embodiment, in the case where reference patterns whichare related to mask data having the same OPC pattern are classified bythe cell name of the design data, repeated defects caused by an OPCpattern can be recognized by inspecting one semiconductor device.Consequently, inspection time can be shortened.

5.1.4 The Fourth Method of Recognizing Repeated Defects

FIG. 83 is a schematic view showing an example of a plurality ofsemiconductor devices that are fabricated based on a photomask having aplurality of the same photomask patterns fabricated based on designdata. In this case, semiconductor devices are fabricated by one-timeexposure using the photomask. As shown in FIG. 83, an error of thedesign data causes repeated defects on all the semiconductor devices. Onthe other hand, a defect on the photomask causes repeated defects on thesame location described by the photomask coordinates. As the fourthmethod of recognizing repeated defects, the following procedure can beused for such semiconductor devices.

In this embodiment, as the first step, with regard to the semiconductordevices fabricated by one-time exposure using the photomask, defectinformation is obtained and repeated defects are recognized by theabove-mentioned 5.1.1 The first method of recognizing repeated defect.The obtained repeated defects are recognized as repeated defects causedby the error of the design data. Next, an unrepeated defect is obtainedby removing the repeated defects from all the defects in the defectinformation.

As the second step, with regard to the semiconductor device fabricatedby another one-time exposure using the photomask, defect information isobtained by inspecting the same location, described by the photomaskcoordinates, of the obtained unrepeated defect and its neighborhood,then the repeated defects are recognized. The above-mentioned 5.1.2 Thesecond method of recognizing repeated defects can be used for the aboveprocessing. In this case, instead of using a defect detected from theentire inspection area in at least one of semiconductor devices, theunrepeated defect is used. The repeated defects obtained by the modified5.1.2 The second method of recognizing repeated defects are recognizedas repeated defects caused by the defect on the photomask. A defectexcept for the obtained repeated defects is recognized as a randomdefect such as a particle on the semiconductor device.

Generally, the number of the repeated defects caused by the error of thedesign data is larger than the number of the repeated defects caused bythe defect on the photomask. Therefore, by using this embodiment,inspection time can be made shorter than inspection time in the case ofusing the above-mentioned 5.1.1 The first method of recognizing repeateddefects or 5.1.2 The second method of recognizing repeated defects.Further, the defects can be classified into the repeated defects causedby the error of the design data, the repeated defects caused by thedefect on the photomask, and the random defect.

5.2 Region Inspection Method

In the above-mentioned 4.6 The first inspection and the above-mentioned4.12 The second inspection, the design data is simply transformed intothe reference pattern. As an alternative inspection method, aninspection method in which a reference pattern suitable for a regioninspection method is extracted by using geometrical information of linesegments constituting design data, and/or by using relationship betweenline segments that contact with each other or are located closely toeach other can be used. The region inspection method means an inspectionmethod in which edges facing each other are used.

As the region inspection method, methods of inspecting a line width, anaverage line width, a space width, and an average space width of aline-shaped pattern; a line width, an average line width, a space width,and an average space width of a curvilinear-shaped pattern; a part thatis liable to cause an open or bridge defect; and a gate width can beused.

5.2.1 Methods of Inspecting Line Width, Average Line Width, Space Width,and Average Space Width of Line-Shaped Pattern

A semiconductor device process is controlled by monitoring a line width,an average line width, a space width, or an average space width.According to this embodiment, an inspection method in which a referencepattern suitable for inspection of the line width, the average linewidth, the space width, or the average space width is extracted fromdesign data; and an allowable pattern deformation quantity for the linewidth, the average line width, the space width, or the average spacewidth is set to the extracted reference pattern can be used. Theinspection method is performed in the following procedure:

FIG. 84 is a schematic view showing a rule for automatically extractingreference patterns suitable for line width inspection from design data.A line-shaped pattern of the design data that has a width smaller than apredetermined maximum line width Lw and has a length longer than apredetermined minimum line length Lm is an object for obtaining areference pattern suitable for line width inspection. As shown in theleft side of FIG. 84, there are three line-shaped patterns in the designdata. The left line-shaped pattern can be the object to be processed,but the middle line-shaped pattern cannot be the object to be processedbecause the middle line-shaped pattern has a width larger than themaximum line width Lw. Further, the right line-shaped pattern cannot bethe object to be processed because the right line-shaped pattern has alength shorter than the minimum line length Lm.

Next, as shown on the right-hand side of FIG. 84, the selectedline-shaped pattern is shortened from its terminations by apredetermined termination shortening length Lo. The line-shaped patternis divided into rectangles having a length Li, and the dividedrectangles are set as reference patterns A (shown by solid lines) forline width inspection. Further, reference patterns B (shown by doublelines) whose centers are located at boundaries between the adjacentreference patterns A for line width inspection may be added for linewidth inspection.

By addition of the reference patterns B, defect detection capability isimproved in the case where a defect exists in the boundaries of thereference patterns A and their neighbors. The higher a ratio of a defectsize to a reference pattern size is, the higher defect detectioncapability is. The ratio of the defect size to the reference patternsize in the case where the defect exists in the one reference pattern isdefined as R. Then, two respective ratios of the defect size to thereference pattern size in the case where the defect, which has the samesize as the above, exists in the two reference patterns in a dividedmanner are less than R. Therefore, the defect detection capability ishigher in the case where the defect exists in the one reference pattern.

As shown in FIG. 85, a line-shaped pattern of the design data having atleast one corner is separated into a plurality of rectangles at thecorner, and then the plurality of rectangles is processed. In an exampleshown in FIG. 85, the line-shaped pattern (L-shaped polygon) having acorner (shown by dotted lines) is separated into two rectangles (shownby the solid lines).

The space width inspection can be realized in the same process describedabove by using inverted design data. The inverted design data isproduced by inverting inside and outside of a pattern in the designdata, i.e. inverting the inside into the outside and the outside intothe inside. FIG. 86 is a schematic view showing a rule for automaticallyextracting a reference pattern suitable for space width inspection fromdesign data. As shown in FIG. 86, Lm′, Lw′, Li′, and Lo′ are the same asLm, Lw, Li, Lo, however, the values of Lm′, Lw′, Li′, and Lo′ aredifferent from those of Lm, Lw, Li, and Lo. By using these values, thespace width inspection may be performed in the same manner as the methoddescribed in FIG. 84. The values of Lm, Lw, Li, Lo, Lm′, Lw′, Li′, andLo′ are controlled as the above-mentioned 3.3 Recipe data “5. themaximum line width, the minimum line length, and the terminationshortening length of a reference pattern suitable for line widthinspection; and the maximum line width, the minimum line length, and thetermination shortening length of a reference pattern suitable for spacewidth inspection”.

An inspection method in which the reference patterns suitable for linewidth inspection and the reference patterns suitable for space widthinspection are used is performed in the following procedure:

Average edge locations of edges of an image of a pattern to-be-inspectedcorresponding to line segments in the obtained reference pattern thathad existed in the design data are calculated. A distance between theaverage edge locations is calculated. If a difference between thedistance and a line width or space width W of the design data exceedsthe above-mentioned 3.3 Recipe data “2. The allowable patterndeformation quantity of a line width”, or “The allowable patterndeformation quantity of a space width”, it is recognized that theportion corresponding to the reference pattern has a defect.

FIG. 87 is a schematic view showing the inspection method in which areference pattern suitable for line width inspection and a referencepattern suitable for space width inspection is used. The referencepattern includes line segments Ld (shown by double lines) which hadexisted in the design data, and line segments Le added when separatedinto rectangles. As shown in FIG. 72, profiles are acquired in adirection perpendicular to the line segments Ld, and edges are detectedfrom the profiles as shown in FIG. 76. The detected edge locations areaveraged to calculate an average edge location.

As shown in FIG. 87, the left average edge location A and the rightaverage edge location B are calculated. Next, the distance W′ betweenthe left average edge location A and the right average edge location Bis calculated, and then a difference between the distance W′ and theline width W of the design data is calculated. If this difference islarger than the allowable pattern deformation quantity, it is recognizedthat the portion corresponding to the reference pattern has a defect.

As an alternative method, a method in which all profiles with regard tothe line segment Ld are acquired, and these profiles are averaged toobtain an average edge location can be used.

The above description also is made for methods of inspection of theaverage line width and the average space width. Instead of using theaverage values, a method in which an individual line width or anindividual space width is inspected can be used.

Further, as described later, 5.3.1 Method of inspecting gate line widthis a kind of the inspection methods of the line width and the averageline width of the line-shaped pattern. In 5.3.1 Method of inspectinggate line width, a method of extracting a gate pattern as a referencepattern suitable for line width inspection is added.

5.2.2 Methods of Inspecting Line Width, Average Line Width, Space Width,and Average Space Width of Curvilinear-Shaped Pattern

Methods of inspecting a line width, an average line width, a spacewidth, and an average space width of a curvilinear-shaped pattern thatcannot be inspected by the above region inspection methods can be used.A typical example of the curvilinear-shaped pattern is a corner part ofdesign data. Although complex calculation for methods of inspecting acurvilinear-shaped pattern is required, these inspection methods are asimportant as the above methods for inspecting the line-shaped pattern inorder to control a semiconductor device process.

FIG. 88 is a schematic view showing a method of obtaining a referencepattern suitable for line width inspection of a corner part of designdata, and FIG. 89 is a schematic view showing a method of inspecting theminimum line width of the curvilinear-shaped pattern that is the cornerpart of the design data.

As shown in FIG. 88, polygons CP1, CP2, and CP3 are obtained bysubtracting reference patterns (two rectangles shown by solid lines)suitable for the line width inspection of the line-shaped pattern from areference pattern (L-shaped polygon shown by dotted lines) obtained fromthe design data. The polygon CP2 that does not contain an end is chosenas a reference pattern suitable for line width inspection of a cornerpart of design data.

A line width to-be-inspected is the minimum distance between curvilinearlines (shown by bold solid lines in FIG. 89 corresponding to theL-shaped line segments having corners rounded off by the curve as shownin FIG. 18) corresponding to line segments that had existed in thedesign data. First, the second edges (see FIGS. 72 through 76)corresponding to these curvilinear lines are detected. In FIG. 89,double lines represent profile acquisition sections and solid circles(●) represent the detected second edges.

The following procedure is performed for all the detected second edgescorresponding to the curvilinear line on the lower left side:

1. Distances from one of the detected second edges corresponding to thecurvilinear line on the lower left side to all the detected second edgescorresponding to the curvilinear line on the upper right side arecalculated.

2. The shortest distance of the above distances is chosen.

In the case where the shortest distance in the obtained distances isshorter than the above-mentioned 3.3 Recipe data “2. The allowableminimum line width”, it is recognized that a part corresponding to thereference pattern has a defect. A method of inspecting an average linewidth may also be performed by calculating an average distance, insteadof the shortest distance.

The curvilinear-shaped patterns are composed of a plurality ofline-shaped patterns that have different line widths in general. Inaddition, the curvilinear-shaped patterns are used for connection ofcircuits. From the above reasons, the method of inspecting the minimumline width is more suitable than the method of inspecting the line widththat uses the allowable pattern deformation quantity.

An alternative method in which the erosion operation is used can beused. The erosion operation is described in the above-mentioned 4.6.1Method of recognizing defect having abnormal pattern deformationquantity. FIG. 90 is a schematic view showing a method of inspecting theminimum line width of the curvilinear-shaped pattern that is the cornerpart of the design data, using the erosion operation. A method ofinspecting the minimum line width using the erosion operation isperformed in the following procedure:

1. A polygon is made from the detected second edges on the lower leftside and the detected second edges on the upper right side with all thedetected second edges sequentially connecting clockwise orcounterclockwise. In FIG. 90, all the detected second edges areconnected sequentially clockwise by line segments as shown by arrowsCW1-CW5.

2. The above polygon is transformed into a binary bitmap (a grid-likepart in FIG. 90).

3. Rectangles having a width equal to a radius of a structure element,which is used in the erosion operation, are attached to line segmentsL_(C) that are added when the polygon CP2 was made (two rectangles shownby dotted parts in FIG. 90).

4. A result of the erosion operation on the above binary bitmap isobtained (the two regions Me surrounded with bold lines in FIG. 90). Thestructure element used in erosion operation is a circle whose diameteris an absolute value of the above-mentioned 3.3 Recipe data “2. Thelimits values of the negative side of the allowable pattern deformationquantity of a line width”.

5. If portions IL_(C) of the bitmap corresponding to the line segmentsL_(C) are connected through the regions Me, it is recognized that a partcorresponding to the reference pattern does not have a defect. However,in this case, the portions IL_(C) corresponding to the line segmentsL_(C) are not connected through the regions Me, and therefore it isrecognized that this part has a defect.

As an equivalent process of the above-mentioned steps 1 through 5, thesize processing for the polygon shown by the arrows CW1-CW5 may be used.In this case, the line segments L_(C) are not size-processed, and otherline segments in the polygon are size-processed by a half of theabsolute value of the above-mentioned 3.3 Recipe data “2. The limitsvalues of the negative side of the allowable pattern deformationquantity of a line width” in order to shrink. If the size-processedpolygon has line segments corresponding to both of the line segmentL_(C), it is recognized that a part corresponding to the referencepattern does not have a defect; otherwise it is recognized that thispart have a defect.

Although, he above description is made for the method of inspecting theline width, a space width is inspected in the same manner.

According to these embodiments with regard to the region inspections,defect detection capability and defect recognition accuracy can beimproved, because the above-mentioned region inspections use a pluralityof edge information.

5.2.3 Method of Inspecting Part that is Liable to Cause Open or BridgeDefect

As a kind of the methods of inspecting the line width of the line-shapedpattern and the space width of the line-shaped pattern, a method ofinspecting a part that is liable to cause an open or bridge defect canbe used. FIG. 91 is a schematic view showing a method in which a partthat is liable to cause an open or bridge defect is extracted. As shownon the right-hand side of FIG. 91, a part (shown by a rectangle γ) of aline-shaped pattern of design data, whose line width is narrower thanthe above-mentioned 3.3 Recipe data “5. The maximum line width Bw of apart that is liable to cause an open defect”, and whose length isshorter than the above-mentioned 3.3 Recipe data “5. The maximum linelength B1 of a part that is liable to cause an open defect”, isextracted.

The extracted part (shown by the rectangle γ) means a part that isliable to cause open, and the part is set as a reference pattern. Thesecond edge detection is performed with regard to a line segment α and aline segment β, which are both sides of the rectangle γ, in the samemanner shown in FIG. 87. The line segment β has corner roundness.Therefore, without using the average line width, an individual linewidth is inspected.

Similarly, with regard to the part that is liable to cause a bridgedefect, as shown on the right-hand side of FIG. 91, a rectangle ζobtained by using the above-mentioned 3.3 Recipe data “5. The maximumspace width Sw of a part that is liable to cause a bridge defect” and3.3 Recipe data “5. The maximum space length S1 of a part that is liableto cause a bridge defect” is set as the part that is liable to causebridge, and the space width is inspected.

An alternative method of inspecting a part that is liable to cause anopen or bridge defect is performed in the following procedure as shownin FIG. 92:

The left-hand side of FIG. 92 shows schematically a method of inspectinga part that is liable to cause an open defect, and the right-hand sideof FIG. 92 shows schematically a method of inspecting a part that isliable to cause a bridge defect. Patterns shown by bold lines in FIG. 92are the same as the rectangle γ and the rectangle ζ of FIG. 91. Parts ofan image of a pattern to-be-inspected corresponding to grid-like partsof FIG. 92 have a high contrast to the ground; however, Parts of theimage of the pattern to-be-inspected corresponding to a dotted part havea low contrast to the ground. The dotted part of the left-hand side ofFIG. 92 shows open state, and the dotted part of the right-hand side ofFIG. 92 shows bridge state.

In such cases, three kinds of edges exist. One of them is an edge thatexists in a boundary between the ground and the grid-like parts, anotheris an edge that exists in the boundary between the ground and the dottedpart, and the remaining one is an edge that exists in a boundary betweenthe grid-like parts and the dotted part. In the case of the open defectas shown on the left-hand side of FIG. 92, the edges existing in theboundary between the ground and the dotted part are detected so that adefect cannot be detected. Further, in the case of the bridge defect asshown on the right-hand side of FIG. 92, the edges existing in theboundary between the grid-like parts and the dotted part are detected sothat a defect cannot be detected. In either case, a defect existing inthe dotted part can be detected in the following manner:

It is inspected whether the second edge exists or not in the eightsections (shown by G) included in the rectangle γ and the rectangle ζ inthe direction shown by arrows. The second edge should not exist in theseeight sections. Therefore, if the second edge is detected in these eightsections, the rectangle γ or the rectangle ζ is recognized as a defect.

According to this embodiment, an open or bridge defect observed as aweak contrast can be detected. Further, the defect-class havinginformation of an open or bridge defect can be set.

According to these embodiments with regard to the region inspections,inspection for a wide area that cannot be inspected by an operator canbe performed.

5.3 Inspection Methods in which Result of the Boolean Operation onReference Patterns is Used

In the above-mentioned 4.6 The first inspection and the above-mentioned4.12 The second inspection, inspection is performed by using a referencepattern with regard to a process at the time of the inspection. However,by using inspection methods in which a result of the Boolean operationon a reference pattern with regard to a process at the time of theinspection and a reference pattern with regard to related process of theprocess at the time of the inspection is used, advanced inspections canbe realized.

5.3.1 Method of Inspecting Gate Line Width

As the first inspection method in which a result of the Booleanoperation on reference patterns is used, an inspection method in which areference pattern suitable for region inspection is extracted by using aresult of the Boolean operations can be used. As the method, a method ofinspecting a gate line width or a method of inspecting an end-cap isperformed.

For inspecting a semiconductor device, a method of inspecting a gatewidth of a transistor is used. An object of the gate widthto-be-inspected is an overlapping part of a reference pattern withregard to a polycrystalline silicon process and a reference pattern withregard to an active process (the preceding process of thepolycrystalline silicon process). FIG. 93 is a schematic view showing aninspection method in which a reference pattern obtained from a result ofthe Boolean AND operation on a reference pattern with regard to aprocess at the time of inspection (the polycrystalline silicon process)and a reference pattern with regard to the preceding process or thesubsequent process (the active process) are used.

A reference pattern C (a rectangle shown by solid lines) is obtainedfrom a result of the Boolean AND operation on a reference pattern withregard to the polycrystalline silicon process and a reference patternwith regard to the active process. The Boolean AND operation used inthis calculation is a well-known operation used in computationalgeometry. The inspection is performed in the same manner as theabove-mentioned 5.2.1 Methods of inspecting line width and average linewidth of line-shaped pattern by using the reference pattern C.

According to this embodiment, the gate portion is automaticallyextracted. Therefore, all the gate widths of the entire semiconductordevice can be automatically inspected, and the inspection can contributeto performance improvement of a semiconductor device.

5.3.2 Method of Inspecting End-Cap

As a kind of methods of inspecting an end, a method of inspecting anend-cap of a gate is used. First, a method of recognizing an end-capwill be described. Polygons are obtained by subtracting the referencepattern C from the reference pattern with regard to the polycrystallinesilicon process as shown in FIG. 93. These polygons are a polygon F anda polygon G in FIG. 93. A polygon that satisfies the followingconditions is recognized as the end-cap:

1. A polygon is a rectangle whose line width W (in FIG. 93) is apredetermined value or less.

2. A rectangle has a distance D (FIG. 93) between line segments facingeach other (one of which is the end), and this distance D has apredetermined value or less.

The polygon that satisfies these conditions is the polygon F. Next, theend in the polygon F is inspected in the same manner as that shown inFIGS. 69A and 69B. An allowable pattern deformation quantity forcontrolling shrinkage of the end-cap of the gate is smaller than that ofa simple end. This is because the effective gate length should beensured.

According to this embodiment, the end-cap of the gate can be inspectedmore strictly, because the allowable deformation, which is smaller thanthe allowable deformation of the simple end, can be automatically set tothe end-cap of the gate.

5.3.3 Method in which Allowable Pattern Deformation Quantity of End ofWiring Pattern to be Connected to Contact Hole/Via Hole is AdaptivelySet

As the second inspection method in which a result of the Booleanoperation on reference patterns is used, a method in which an allowablepattern deformation quantity of end of wiring pattern to be connected tocontact hole/via hole is adaptively set can be used. In this method, anend to be connected to a contact hole/via hole, whose margin does nothave a certain value, is recognized, and an allowable patterndeformation quantity is adaptively set to the recognized end, and thenthe end is inspected. FIG. 94 is a schematic view showing the abovemethod.

A contact-area of a contact hole/via hole with an end of a wiringpattern is inspected. Even if an end has the same or similar shape, anallowable pattern deformation quantity for controlling shrinkage of theend to be connected to the contact hole/via hole is smaller than that ofa simple end. This is because the contact-area should be ensured.

The allowable pattern deformation quantity of the end of the wiringpattern to be connected to the contact hole/via hole is determined inconsideration of an overlay error between a wiring process and a contacthole/via hole process, and a margin of an end. Almost all margins ofends should keep a certain value or larger. However, a margin of an endof dense wiring patterns may not keep the certain value or larger.

A method of recognizing an end to be connected to the contact hole/viahole, whose margin does not have a certain value, is performed as thefollowing procedure:

1. The rectangles shown by solid lines on the upper left side of FIG. 94that include line segments Lea as ends of the wiring patterns and have alength equal to an allowable pattern deformation quantity in the inwarddirection of the wiring patterns are produced. Hereafter, theserectangles are called “end neighborhood patterns”.

2. Results of the Boolean AND operation on the end neighborhood patternsand reference patterns with regard to a contact hole/via hole processare obtained as a region, which is a rectangle region shown by a dottedpart. The end, whose margin may not keep a certain value or larger,generates the region obtained by the Boolean AND operation.

An allowable pattern deformation quantity of the end shrinkage of thewiring pattern related to the generation of the region (dotted part) ismade smaller than the allowable pattern deformation quantity of the endshrinkage for other ends. The quantity to be made smaller corresponds toa length Δ in FIG. 94. An allowable pattern deformation quantityreflected by the length Δ is adaptively set to the recognized end, andthen the end is inspected.

According to this embodiment, the allowable pattern deformation quantityof end shrinkage can be adaptively set according to the margin which theend to be connected to a contact hole/via hole has.

5.3.4 Method of Inspecting Contact-Area

As the third inspection method in which a result of the Booleanoperation on reference patterns is used is a method of inspecting acontact-area of a contact hole/via hole and an end of a wiring patterncan be used. FIGS. 95A and 95B are schematic views showing the abovemethod.

First, a reference pattern Rca is obtained by the Boolean AND operationon a reference pattern with regard to a contact hole/via hole processand a reference pattern with regard to a wiring process in the samemanner as shown in FIG. 93. The Boolean AND operation is described in5.3.1 Method of inspecting gate line width.

Next, edges corresponding to segments Ld (shown by double lines) whichhad existed in the design data are detected in the same manner as shownin FIG. 87. A polygon Pea is obtained by connecting the detected edges.Each line segment shown by a dotted line in FIG. 87 connects a terminalof detected edges corresponding to one of line segments Ld with aterminal of the detected edges corresponding to the other line segmentLd.

Finally, a ratio of an area of the polygon Pea to an area of thereference pattern Rca is calculated. If the ratio is less than theabove-mentioned 3.3 Recipe data “2. The allowable contact-areainspection ratio”, it is recognized that a part corresponding to thereference pattern Rca has a defect.

5.4 Method of Inspecting Correction Pattern that should not be Formed onWafer

In the above-mentioned 4.6 The first inspection and the above-mentioned4.12 The second inspection, a pattern that should be formed on a waferis inspected. As another inspection, a correction pattern that shouldnot be formed on a wafer is inspected. For example, as a kind of OPCpattern, a correction pattern arranged in the neighborhood of a patternto be corrected is added to mask data. The correction pattern should notbe formed on a wafer. However, the correction pattern might be formed asa defect. Although such patterns are used in plenty, currently, therehas not been automatic inspection method.

FIG. 96A is a diagram showing an example of correction patterns thatshould not be formed on a wafer, and FIG. 96B is a schematic viewshowing a method of inspecting correction patterns that should not beformed on a wafer. In order to solve this problem, the inspection methodis performed in the following procedure:

1. The OPC patterns are converted into reference patterns. In thisinspection method, the OPC pattern is used instead of design data.

2. As shown in FIG. 96B, the second edges are detected by using thereference patterns. Such OPC patterns formed on a wafer have fardifferent shapes from the shapes of the reference pattern, even if theOPC patterns are formed. Therefore, it is necessary for profileacquisition sections to be large in order to cover the deformations.

3. If a ratio of the number of the detected second edges to the numberof profile acquisition sections is greater than the above-mentioned 3.3Recipe data “2. The defect judgment coefficient K_(cp) of a correctionpattern that should not be formed on a wafer”, it is recognized thatthis part has a defect. The defect judgment coefficient K_(cp) is lessthan 0.1, and is empirically determined.

According to this embodiment, the method of inspecting the correctionpattern that should not be formed on a wafer can be realized by applyingthe edge detection.

5.5 Inspection Method in which Inspection Result of Patternto-be-Inspected of Standard Semiconductor Device is Used

In the above-mentioned 5.3.2 Method of inspecting end-cap and 5.3.3Method in which allowable pattern deformation quantity of end of wiringpattern to be connected to contact hole/via hole is adaptively set, theallowable deformation quantities of end shrinkage are set by using thedesign data.

As an alternative method of the above-mentioned methods, a method ofinspecting the end shrinkage by using a result of inspection of apattern to-be-inspected of a standard semiconductor device can be used.An end except for an end-cap and an end of a wiring pattern to beconnected to a contact hole/via hole may not be corrected by an OPCpattern correctly. Even if the end is shrunken by more than an allowablepattern deformation quantity for an end-cap or an end of a wiringpattern to be connected to a contact hole/via hole, it is not necessaryto recognize the shrunken end as a defect. According to this embodiment,such end, which is shrunken by more than the allowable patterndeformation quantity of end shrinkage, can be ignored. FIG. 97 is aschematic view showing an example of an end, which is shrunken by morethan an allowable pattern deformation quantity, but is not necessary tobe recognized as a defect.

First, a pattern to-be-inspected of a standard semiconductor device isinspected. The standard semiconductor device means a semiconductordevice that is judged to have a good quality by using another inspectionmethod. Although the standard semiconductor device has a good quality, adefect may be detected. The detected defect is called a nuisance defect,which is defined as a defect that is not necessary to be recognized as adefect.

Next, a semiconductor device to-be-inspected is inspected to detect adefect. In the case of the detected defect whose location and sizecorrespond to those of the above-mentioned nuisance defect, the defectis deleted from inspection result. According to this embodiment,generation of nuisance defects can be reduced.

5.6 Method of Obtaining Optimal Allowable Pattern Deformation Quantityby Inspecting Standard Specimen

The optimal allowable pattern deformation quantity depends on adesirable electrical property. Therefore, it is necessary to provide amethod of obtaining an optimal allowable pattern deformation quantity byinspecting a standard specimen. The standard semiconductor device meansa semiconductor device having good quality that is judged by usinganother inspection method.

FIG. 98 is a schematic view showing a method of obtaining an optimalallowable pattern deformation quantity. First, the identical patternto-be-inspected of a standard specimen is inspected repeatedly in orderto obtain inspection results, while altering an allowable patterndeformation quantity successively. In FIG. 98, relationship between thenumber of detected defects in the inspection results and the employedallowable deformation quantities is shown by a curve.

Next, an allowable pattern deformation quantity, which corresponds to anintersection point of the curve shown in FIG. 98 with an estimatednumber of defects caused by noise, is taken as the optimal allowablepattern deformation quantity. The estimated number of defects caused bynoise is empirically determined.

According to this embodiment, the optimal allowable pattern deformationquantity can be automatically obtained by inspecting a standardspecimen.

5.7 Method of Inspecting Patterns Requiring Signal Intensity Correction

In the above-mentioned 4.6 The first inspection and the above-mentioned4.12 The second inspection, a pattern to-be-inspected is inspectedindividually. However, in some cases, a distance between two edges of apattern to-be-inspected is observed to be narrower than the actualwidth, or to be wider than the actual width due to phenomena caused by avariation in generation rate of charged particles and a variation incapture rate of secondary charged particles. These phenomena appear inparts of patterns to-be-inspected corresponding to proximate linesegments and remote line segments of a reference pattern. The proximateline segments are defined as line segments that face each other closesttogether with a distance between them shorter than a predetermineddistance. The remote line segments are defined as line segments thatface each other closest together with a distance between them longerthan a predetermined distance.

For example, in some cases, a distance between two edges correspondingto the proximate line segments is observed to be wider than the actualwidth, or a distance between two edges corresponding to the remote linesegments is observed to be narrower than the actual width. According tothis embodiment, positions of the proximate/remote line segments arecorrected and allowable deformation quantities of the proximate/remoteline segments are set to different values from those of other linesegments of the reference pattern to cancel these phenomena.

Further, in some cases, a distance between two edges corresponding tothe remote line segments is shorter than a distance between those indesign data, due to a variation in process condition. However, anelectrical property of a semiconductor device is not necessarilyaffected by this shorter distance. In such cases, the allowabledeformation quantities of the remote line segments are made larger toneglect the shorter distance.

FIG. 99 is a schematic view showing a method of extracting proximateline segments from reference patterns. The maximum distance between theproximate line segments that requires correction is taken as Dp. First,line segments close to the one shown by a bold line on the right-handside of a left rectangle in the left frame of FIG. 99 are obtained. Linesegments to be obtained face the line segment shown by the bold line,exist in the rightward direction, and correspond to line segments forforming the left sides of the reference patterns (shown by dotted linesin the left frame of FIG. 99). Next, the line segment Lp (shown by thedotted line) being a part of a central rectangle is selected, becausethe line segment Lp is located within the distance Dp from the boldline. Finally, the selected line segment Lp is projected on the linesegment (shown by the bold line), and an overlapping part is recognizedas a proximate line segment to be corrected (shown by a wavy line in theright frame of FIG. 99).

With regard to the proximate line segment, the correction of theposition of the line segment is made, and the allowable patterndeformation quantity is set to a different value from those of otherline segments. In this case, the position correction quantity or theallowable pattern deformation quantity may be variable according to thedistance.

FIG. 100 is a schematic view showing a method of extracting remote linesegments from reference patterns. The minimum distance between theremote line segments that requires correction is taken as Dt. First,line segments close to the one shown by a bold line on the right-handside of a left rectangle in the left frame of FIG. 100 are obtained.Line segments to be obtained face the line segment shown by the boldline, exist in the rightward direction, and correspond to line segmentsfor forming the left sides of reference patterns (shown by dotted linesin the left frame of FIG. 100).

Next, line segments Lt (shown by the dotted lines) are selected, becausethey are located within the distance Dt from the bold line. Finally, theselected line segments Lt are projected on the line segment (shown bythe bold line), and an overlapping part is recognized as a line segmentnot to be corrected (shown by a wavy line in the right frame of FIG.100). Finally, the line segment that is a part of the line segment shownby the bold line and is not a part shown by the wavy line is recognizedas a remote line segment.

Also with regard to the remote line segment, the correction of theposition of the line segment is made, and the allowable patterndeformation quantity is set to a different value from those of otherline segments. In this case, the position correction quantity or theallowable pattern deformation quantity may be variable according to thedistance. For example, the case where a position correction quantity fora part H is set to a smaller quantity than the position correctionquantity for the obtained remote segment and a position correctionquantity for the part J is set to zero can be used.

According to this embodiment, by correcting the position of the linesegment of the reference pattern or setting the allowable patterndeformation quantity individually, these effects of the above-mentionedphenomena can be reduced.

5.8 Method of Inspecting Pattern to-be-Inspected Affected by Pattern ofPreceding Process

In the case where there is a pattern of a lower layer formed in thepreceding process of a process at the time of the inspection beneath apattern to-be-inspected, part of the pattern to-be-inspected where thereis a pattern of the lower layer formed in the preceding process of theprocess at the time of the inspection and part of the patternto-be-inspected where there is no pattern of the lower layer formed inthe preceding process of the process at the time of the inspection havedifferent shapes, and are sometimes observed differently. In order tosolve this problem, it is necessary to provide a method in whichinspection is performed by using different inspection parametersaccording to the part of the pattern to-be-inspected where there is thepattern of the lower layer formed in the preceding process of theprocess at the time of the inspection and the part of the patternto-be-inspected where there is no pattern of the lower layer formed inthe preceding process of the process at the time of the inspection.

FIG. 101 is a schematic view showing the case where there is a patternof a lower layer formed in the preceding process of a process at thetime of the inspection beneath a pattern to-be-inspected. In such case,inspection is performed by separating an inspection area into an insidepart, a boundary part, and an outside part of the pattern of thepreceding process of the process at the time of the inspection. Theinside part of the pattern of the preceding process of the process atthe time of the inspection is recognized by the same manner as thereference pattern C described in the above-mentioned 5.3.1 Method ofinspecting gate line width. The boundary part of the pattern of thepreceding process of the process at the time of the inspection isrecognized as a band-shaped part whose centerline is a reference patternof the preceding process of the process at the time of the inspectionand whose width has a predetermined value that is determinedempirically. The outside part of the pattern of the preceding process ofthe process at the time of the inspection is the remainder of parts.

The inside part and the outside part of the pattern of the precedingprocess of the process at the time of the inspection may have differentcontrast due to an effect of the pattern of the preceding process of theprocess at the time of the inspection. In addition, the patternto-be-inspected is formed in different widths due to undulation of a topsurface of the lower layer.

In order to cancel the effect, position correction quantities for a linesegment of a reference pattern and allowable deformation quantities areset separately to line segments in the inside part of the pattern of thepreceding process of the process at the time of the inspection and linesegments in the outside part of the pattern of the preceding process ofthe process at the time of the inspection respectively. If the boundarypart is suitable for edge detection, a different position correctionquantity and an allowable pattern deformation quantity are set to theboundary part. If the boundary part is not suitable for edge detection,this boundary part is excluded from the inspection area.

According to this embodiment, probability of detecting a defect(nuisance defect) that is not necessary to be recognized as a defectshown in the grid-like parts of FIG. 101 can be reduced.

5.9 Method of Inspecting Relationship Between Location of Patternto-be-Inspected and Location of Pattern of Preceding Process

As an inspection method which can be used for the case where there is apattern of a lower layer formed in the preceding process of a process atthe time of the inspection beneath a pattern to-be-inspected, a methodof inspecting relationship between a location of a patternto-be-inspected and a location of a pattern of the preceding process ofthe process at the time of the inspection can be used.

In this embodiment, a reference pattern with regard to a process at thetime of the inspection, and a reference pattern with regard to thepreceding process of the process at the time of the inspection are used.FIG. 102 is a schematic view showing an example of an image of a patternto-be-inspected, a reference pattern with regard to a process at thetime of the inspection, and a reference pattern with regard to thepreceding process of the process at the time of the inspection.

First, matching is performed by using the reference pattern with regardto the process at the time of the inspection, the reference pattern withregard to the preceding process of the process at the time of theinspection, and the image of the pattern to-be-inspected. Generally, anedge placement error, which is called the overlay error, exists betweenthe pattern formed in the process at the time of the inspection and thepattern formed in the preceding process of the process at the time ofthe inspection. Next, a shift quantity S₃, which is described in theabove-mentioned 4.12 The second inspection, is calculated by using thereference pattern with regard to the process at the time of theinspection and the image of the pattern to-be-inspected. The obtainedshift quantity S₃ is taken as a shift quantity S_(U). A shift quantityS_(D) is calculated by using the reference pattern with regard to thepreceding process of the process at the time of the inspection and theimage of the pattern to-be-inspected in the same manner. Finally, adifference between the shift quantity S_(U) and the shift quantity S_(D)is taken as the overlay error quantity.

By calculating the overlay error for each inspection unit area in theentire semiconductor device, overlay error distribution of the entiresemiconductor device can be obtained. Conventionally, the overlay erroris controlled by measuring limited areas in the semiconductor device,and therefore the local overlay error caused by a stepper aberration orthe like cannot be controlled. However, according to this embodiment,the obtained overlay error distribution of the entire semiconductordevice can be used for controlling the local overlay error over theentire semiconductor device.

5.10 Inspection Method in which Contours are Used

5.10.1 Die-to-Die Comparison Method in which Contours are Used

The conventional die-to-die comparison method is performed by comparingcorresponding two images. In this method, it is necessary for luminancevalues of pixels to be interpolated so that the two images have the samerelationship between a pattern to-be-inspected and pixel boundaries.However, in this embodiment, edges of the two images are compared, andtherefore interpolation of luminance value is not necessary.Consequently, inspection accuracy is improved.

FIG. 103 is a flowchart showing a die-to-die comparison method in whichcontours are used. FIG. 103 is made based on FIG. 27. A block A of FIG.103 is identical to the block A of FIG. 26, and is a preparation processbefore the inspection. A block Bs of FIG. 103 shows an inspectionprocess of an inspection area with regard to a standard semiconductordevice. The block Bs of FIG. 103 is identical to the block B of FIG. 26except for the following steps:

1. Instead of performing the step S336 (the second inspection), acontour is obtained from the standard semiconductor device. Hereafter,this processing is called step S336-1.

2. Instead of performing the step S338 (outputting the defectinformation to the defect information storage unit 24), the contourobtained by S336-1 is outputted to the defect information storage unit24. Hereafter, this processing is called step S338-1.

A block Bt of FIG. 103 shows the inspection process of the inspectionarea with regard to a semiconductor device to-be-inspected. The block Btof FIG. 103 is identical to the block B of FIG. 26 except for thefollowing steps:

3. Instead of performing the step S336 (the second inspection), thedetected second edge is compared with the stored contour in the defectinformation storage unit 24. Hereafter, this processing is called stepS336-2.

Step S510 (the defect information in the defect information storage unit24 is outputted to the display device 5 and the printer 6 through theoutput unit 13) is identical to the step S410 except for outputting aresult of the die-to-die comparison method as the defect information.

FIG. 104 is a schematic view showing a die-to-die comparison method inwhich contours are used. The inspection-unit-areas in the step S340 areobtained by dividing the inspection area represented by the coordinatesystem used in the design data, and the inspection-unit-areas in eachsemiconductor device are inspected. The inspection-unit-areas of thisembodiment are inspection-unit-areas G1 through G8 of the standardsemiconductor device and inspection-unit-areas H1 through H8 of thesemiconductor device to-be-inspected. The inspection-unit-areas G1through G8 correspond to the inspection-unit-areas H1 through H8,respectively.

First, the steps S336-1 and S338-1 will be described. The Block A andthe steps S308 through S332 in the Block Bs are performed. The secondedges are detected from the inspection-unit-area G1 of the standardsemiconductor device by the step S334 (the second edge detection). Thedetected second edges are connected in the detection order for obtaininga polygon, and the obtained polygon is used as a contour (the stepS336-1). The obtained contour is outputted to the defect informationstorage unit 24 (the step S338-1).

The same processing is applied for the inspection-unit-areas G2 throughG4 successively. The standard semiconductor device means a semiconductordevice having good quality that is judged by using another inspectionmethod. By the above processing, the inspection process of theinspection area with regard to the standard semiconductor device iscompleted.

Next, the steps S336-2 will be described. The steps S308 through S332 inthe Block Bs are performed. The second edges are detected from theinspection-unit-area H1 of the semiconductor device to-be-inspected bythe step S334 (the second edge detection). The detected second edges arecompared with the stored contour with regard to the inspection-unit-areaG1 in the defect information storage unit 24 (the step S336-2).

The same processing is applied for the inspection-unit-areas H2 throughH4 successively. By the above processing, the inspection process of theinspection area with regard to the semiconductor device to-be-inspectedis completed.

FIG. 105 is a schematic view showing a method of comparing the contourwith the second edge. In the case where the two images have the samepixel intervals and the method in which directions and positions foracquiring the profiles are set beforehand by using the second referencepattern is used, a distance D between an edge E_(DI) and an edge E_(DS)is calculated. The edge E_(DI) is an edge detected from a profileacquisition section of the semiconductor device to-be-inspected, and theedge E_(DS) is an edge detected from the profile acquisition section ofthe standard semiconductor device. Those profile acquisition sectionsexist in the same position. The edge E_(DS) is a vertex of the storedcontour.

In the case where the calculated distance D is larger than apredetermined distance, which is an allowable pattern deformationquantity of the die-to-die comparison inspection, it is judged that apart corresponding to the profile acquisition section has a defect. Theallowable pattern deformation quantity of the die-to-die comparisoninspection can be set for all the attributes of a reference pattern, orallowable deformation quantities can be set for the respectiveattributes of a reference pattern.

FIG. 106 is a schematic view showing an alternative method of comparingthe contour with the second edge. In the case where two images havedifferent pixel intervals or the method in which the profile acquisitionsections are adaptively set after detecting the first edges is used,profile acquisition sections do not exist in the same position. In thiscase, an intersection point E_(x) of the contour with the profileacquisition section is obtained, a distance D′ between the second edgeE_(DI) and the intersection point E_(X) is calculated, and theabove-mentioned method is performed by using the distance D′ instead ofusing the distance D.

In the above, the contour obtained from the standard semiconductordevice is used for the inspection. However, a simulator obtains acontour that corresponds to the pattern to-be-inspected, and theobtained contour may be used. In addition, in the case of inspectingperiodical patterns such as part of a memory, a contour obtained fromthe periodical patterns or a contour corresponding to the periodicalpatterns obtained by a simulator may be used. As an alternative method,a process controlling method, in which a contour of a semiconductordevice having good quality at the starting time of fabrication isstored, and the second edge of a semiconductor device that is beingfabricated is compared with the stored contour, can be used.

According to this embodiment, the die-to-die comparison inspection, inwhich contours of patterns to be-inspected are used, can be performedwith sub pixel accuracy, and can be performed by using a contour of oneimage of a pattern to-be-inspected, whose pixel interval is differentfrom a pixel interval of an image of another pattern to-be-inspected, ora contour obtained by a simulator, or the like. Further, a processcontrolling method in which a contour of a semiconductor device havinggood quality at the starting time of fabrication is used can berealized.

5.10.2 Method of Correcting Contour and Methods of Reducing Noise onContour

As described in the above-mentioned 4.11 The second edge detection, thesecond edges in the above-mentioned 5.10.1 Die-to-die comparison methodin which contours are used exist in the different positions frompositions where the edges should be detected ideally. For example, inthe case of using the coefficient k in FIG. 76 equal to 0.5, thedetected edge exists in the position shifted from the ideal position bythe half of the electron beam spot size in the outward direction of thepattern to-be-inspected. In the case of comparing contours, which areobtained from images acquired by using different electron beam spotsizes, the die-to-die comparison should be applied after correcting theedge shift quantity caused by the electron beam spot size.

The edge shift quantity W_(beam) caused by the electron beam spot sizeis obtained by the following equation:W _(beam)=(W _(measure) −W _(standard))/2where a line width W_(standard) means a standard line width and a linewidth W_(measure) means a line width obtained by measuring a patternto-be-inspected having a standard line width.

FIG. 107 is a schematic view showing a method of correcting a contour.As shown in FIG. 107, the second edge is shifted by the edge shiftquantity W_(beam) along the profile acquisition section in the insidedirection (the opposite direction) of the pattern-to-be-inspected inorder to cancel the edge shift quantity W_(beam). Then a position of theshifted second edge is registered as a position of a vertex of acontour.

Next, a method of reducing a spike noise on a contour will be described.FIG. 108 is a schematic view showing a method of reducing a noise on acontour. A contour shown on the left-hand side of FIG. 108 by dottedlines has a spike noise. The spike noise has about one pixel width andabout two or three pixel length. In order to reduce such a spike noise,a contour shown on the left-hand side of FIG. 108 by solid lines isobtained by applying the size processing to the contour by a half of apixel interval. Then, a contour shown on the right-hand side of FIG. 108by solid lines is obtained by applying the Boolean OR operation to theapplied contour. The obtained contour is a contour after noisereduction. Two triangles exist in a part of the contour shown on theleft-hand side, the part corresponding to the outside of the contourshown by the solid lines on the right-hand side. In order to understandeasily, the two triangles are shown in a large size, however, they aretiny so that they are ignored in practice.

In order to compensate for shrinkage of the contour after the noisereduction, it is necessary to apply the above method of correcting thecontour before the noise reduction. The half of pixel interval issubtracted from the edge shift quantity W_(beam), and the obtainedquantity is used as the edge shift quantity, which compensates for thenoise reduction.

As an alternative method, a method of reducing noise on a contour byusing an average of distances between edges of the second referencepattern and the corresponding second edges of an image of a patternto-be-inspected can be used. FIG. 109 is a schematic view showing amethod of reducing noise on a contour by using an average position ofthe second edge, the preceding edge to the second edge, and thesubsequent edge to the second edge. The average position means aposition whose X and Y coordinate values are average values of the X andY coordinate values of the three edges. The obtained average position isregistered as a vertex of a contour. In this method, although a cornerpart of the contour does not have noise, a curvature of the corner partof the contour after reducing noise is different from a curvature of thecorner part of the contour before reducing noise.

FIG. 110 is a schematic view showing a method of reducing noise on acontour by using an average of distances between edges of the secondreference pattern and the corresponding second edges of an image of apattern to-be-inspected. Although a vector between the two edges havingthe correspondence is shown by d(x,y) in 4.6 The first inspection, thevector is shown by d(i) in order to relate the vector to a vertex of acontour. ‘i’ means a sequential number of a vertex. In order to reducenoise of the second edge that is an end point of a vector d(0), thefollowing calculation is performed by using vectors d(−1), d(0), andd(1):(len(d(−1)+len(d(0)+len(d(1))/3where len is a function that returns a signed length of a vector. Thesign is positive when the vector goes to the outside of a patternto-be-inspected; and the sign is negative when the vector goes to theinside of a pattern to-be-inspected. A vector, which has a length sameas the obtained length, a start point same as a start point of thevector d(0), and a direction same as a direction of the vector d(0), isthe vector d(0) after reducing noise. An end point of the vector d(0)after reducing noise is the second edge after reducing noise.

In this method, a curvature of a corner part of the contour afterreducing noise is not drastically different from a curvature of thecorner part of the contour before reducing noise, because the lengths ofthe vectors used in the above calculation are measured from a curveapplied to the corner part. The number of edges for average length maybe 5, 7, or the other number. Further, the lengths of the vectors may begiven weights. Furthermore, median value of the lengths or the like maybe used, instead of the average lengths. In the case of using the medianvalue of the lengths, it is efficient to reduce spike noise.

According to this embodiment, because correction of the contour orreduction of spike noise on the contour can be performed by shiftingedges, deterioration of the image of the pattern to-be-inspected causedby the image filter is not caused. As an alternative method, in the casewhere noise on the contour is reduced by using distances between edgesof reference pattern and edges of the image of the patternto-be-inspected, variation in curvature of corners can be minimized.

5.10.3 Method of Outputting Contour to External Inspection Device

The contour described in the above-mentioned 5.10.1 Die-to-diecomparison method in which contours are used can be used for input dataof a lithography simulator or the like. In this case, it is necessary toinput the contour indirectly, because lithography simulator processingis slower than contour output processing.

FIG. 111 is a schematic view showing a method of outputting a contour toan external inspection device. The inspection unit (inspection device)12 is the same as the inspection unit (inspection device) 12 in FIG. 16and outputs (sets) a contour obtained from a semiconductor deviceto-be-inspected to a contour database. A lithography simulator retrievesthe contour database and inputs the contour through on-line or off-linelinkage. A plurality of lithography simulators can be connected to thecontour database in order to realize multi-processing. In the case wherethe inspection unit 12 outputs the contour by using additionalinformation of the design data, relationship between the contour and thedesign data becomes clear.

According to this embodiment, an inspection method that can be used incombination with an alternative method, which performs in slowerprocessing, can be realized. In addition, in the case where a contour isoutputted by using additional information of the design data,relationship between the contour and the design data becomes clear.

5.11 Method of Separating Pattern Deformation Quantities into GlobalPattern Deformation Quantities and Local Pattern Deformation Quantities

In the above-mentioned 4.8 Pattern deformation quantities obtained fromthe whole inspection-unit-area, the pattern deformation quantity isobtained for every inspection-unit-area. By using the method, in thecase where the patterns to-be-inspected are globally formed in linewidths different from line widths of the design data due to differencesof conditions of pattern formation, all the pattern deformationquantities obtained from the whole inspection-unit-area, have bigvalues. However, an electrical property of a semiconductor device isrestricted by a variation in line widths in a local region rather than avariation in average line widths in a global region. Therefore, it isnecessary to evaluate an electrical property of the semiconductor deviceby separating the pattern deformation quantities into global patterndeformation quantities and local pattern deformation quantities.

FIGS. 112 through 115 are schematic views showing a method of separatingpattern deformation quantities into global pattern deformationquantities and local pattern deformation quantities. In this embodiment,as a deformation quantity, a deformation quantity of a line width isused. FIG. 112 is a schematic view showing an example in which patternsto-be-inspected are formed in line widths different from line widths ofdesign data over the entire semiconductor device due to differences ofconditions of pattern formation.

As shown in FIG. 112, in a central portion of a semiconductor device,line widths are normal in a global region, and a defect K1 exists. Onthe other hand, in the peripheral portion of the semiconductor device,line widths are dilated in the X direction in the global region. It isassumed that this deformation quantity and the size of the defect K1 inthe X direction have the same quantity M. In this case, the defect K1should be recognized as a defect, but the lines that have thedeformation quantity M should not be recognized as defects. Further, ifthe lines that have the deformation quantity M are recognized asdefects, a great number of defects should be registered.

In order to solve this problem, a method in which line widths of areference pattern are corrected in consideration of a global deformationquantity of an average line width in the global region beforerecognizing defects may be used. In order to correct line widths of thereference pattern, the pattern inspection apparatus should have a firstmethod that obtains a global deformation quantity of an average linewidth using inspected inspection-unit-areas, and a second method ofcorrecting the line widths of the reference pattern using the globaldeformation quantity obtained by the first method. The globaldeformation quantity of the average line width should be obtained from asufficiently large region, but it is not necessary for this region to bethe entire semiconductor device.

FIGS. 113A, 113B and 113C are views showing an example of the firstmethod that obtains a global deformation quantity of an average linewidth using inspected inspection-unit-areas. As a deformation quantityof an average line width, the deformation quantity of the line width inthe X direction used in the above-mentioned 4.8 Pattern deformationquantities obtained from the whole inspection-unit-area is used.

First, by applying the method described in connection with thedeformation quantity of the line width in the X direction (see FIGS. 67Aand 67B) to each inspection-unit-area, a deformation quantity C_(X) of aline width is obtain as shown in FIG. 113A. A deformation quantity of aline width in the Y direction is obtained in the same manner. Ifnecessary, deformation quantities of line widths in 45 degrees and 135degrees may be obtained.

Next, in order to obtain a global deformation quantity <C_(X)> of anaverage line width in the X direction, an average of C_(X) is obtained(< > means the average value). For example, as shown in FIG. 113B, withregard to an inspection-unit-area to-be-corrected (part shown by dots),a method of obtaining an average of C_(X) of inspectedinspection-unit-areas (grid-like parts in FIG. 113B) located near theinspection-unit-area may be used.

Further, in the sequential inspection described in the above-mentioned3.4 Inspection-unit-area (shown in FIG. 113C), with regard to aninspection-unit-area to-be-corrected (part shown by dots), a method ofobtaining an average of the above-mentioned 3.3 Recipe data “8. Thenumber of inspection-unit-areas in order to obtain a global patterndeformation quantity” of C_(X) obtained from the latest inspectedinspection-unit-areas (grid-like parts in FIG. 113C) may be used.Instead of the average, a moving average may be used. Global deformationquantities <C_(Y)>, <C₄₅>, and <C₁₃₅> of the average line widths in theY direction, 45 degree direction, and 135 degree direction can beobtained in the same manner. The obtained global deformation quantities<C_(X)>, <C_(Y)>, <C₄₅>, and <C₁₃₅> become the global patterndeformation quantities.

The global deformation quantities of the average line widths may beseparated into quantities obtained from each group that has the sameattribute of the patterns to-be-inspected. Further, this separation maybe performed by dividing all line segments into proximate line segments,remote line segments, and other line segments, or may be performedaccording to line widths. Further, the global deformation quantity ofthe average line width may be expressed in the form of a function of aline width.

FIG. 114 is a view showing an example of the second method of correctingthe line widths of a reference pattern using the global deformationquantities obtained by the first method. In this embodiment, as theglobal deformation quantities of the average line widths, the aboveglobal deformation quantities <C_(X)>, <C_(Y)>, <C₄₅>, and <C₁₃₅> areused.

When the obtained global deformation quantities <C_(X)>, <C_(Y)>, <C₄₅>,and <C₁₃₅> of the average line widths are used for correction of linewidths of a reference pattern, the size processing (processing in whichthe line width is altered) in step S206 (see FIG. 22) for generating thereference patterns based on the design data is performed. Specifically,each line segment in the reference patterns is moved by the globaldeformation quantities <C_(X)>, <C_(Y)>, <C₄₅>, or <C₁₃₅> of the averageline width in each direction. This step is performed after theinspection unit 12 retrieves the recipe database 22 using the reciperetrieval parameters as a key and takes out the recipe data including areference pattern (step S304).

As an example of this step, a result obtained by the size processing, inwhich the reference patterns (shown in FIG. 112) are altered by theglobal deformation quantity <C_(X)> of the average line width in the Xdirection, is shown by double lines in FIG. 114. Here, the globaldeformation quantity <C_(X)> of the average line width in the Xdirection obtained by the first method is nearly equal to thedeformation quantity M.

The global deformation quantity of the average line width, which is notcalculated in the above calculations, for example, a global deformationquantity <C₃₀> of an average line width in 30 degree direction, isobtained by interpolating the global deformation quantities of theaverage line width, which are calculated in the above calculations.<C ₃₀>=(2<C _(X) >+<C _(Y)>)/3<C ₃₀>=(2<C ₄₅ >+<C _(X)>)/3

In these equations, the global deformation quantity <C_(X)> of theaverage line width in the X direction, the global deformation quantity<C_(Y)> of the average line width in the Y direction, and the globaldeformation quantity <C₄₅> of the average line width in 45 degreedirection are used as the global deformation quantities of the averageline width, which are calculated in the above calculations.

In FIG. 115, the latter calculation example is shown. In FIG. 115, linesegments shown by dotted lines schematically show a reference pattern,and line segments shown by solid lines schematically show edges detectedfrom an image of a pattern to-be-inspected. The global deformationquantity <C_(X)> of the average line width in the X direction, theglobal deformation quantity <C_(Y)> of the average line width in the Ydirection, the global deformation quantity <C₄₅> of the average linewidth in 45 degree direction, the global deformation quantity <C₁₃₅> ofthe average line width in 135 degree direction, and the globaldeformation quantity <C₃₀> of the average line width in 30 degreedirection, are defined based on FIG. 115. On the right-hand side of FIG.115, the global deformation quantity <C₃₀> of the average line width in30 degree direction, which has been obtained by interpolating the globaldeformation quantity <C_(X)> of the average line width in the Xdirection and the global deformation quantity <C₄₅> of the average linewidth in 45 degree direction, is shown.

As an alternative method, a method of detecting each global deformationquantity of an average line width once at a specified position beforeinspection and correcting line widths of a reference pattern in eachinspection-unit-area using the detected global deformation quantity ofthe average line width may be used.

When the steps subsequent to step S304 (see FIG. 25) described in FIG.25 are performed, the defect is detected in step S320 (see FIG. 25). Asdescribed above, in a central portion of the semiconductor device shownin FIG. 112, line widths are normal in a global region, and in theperipheral portion of the semiconductor device shown in FIG. 112, linewidths are dilated in the X direction in the global region. In the casewhere the size processing is performed so that the defect K1 is detectedfrom the semiconductor device shown in FIG. 112, the defect K2 is notdetected and most part of the dilated pattern is recognized as a defect.However, according to this embodiment, as shown in FIG. 114, only thedefect K2 can be recognized as a defect.

As a result, the defect information that is separated into the globaldeformation quantities of the line widths in each inspection-unit-areaas the global deformation quantities and defect information as the localdeformation quantities can be outputted.

In the case of using this embodiment, it is necessary to cancel thevariation in defect information caused by correcting the line widths ofthe reference pattern. Specifically, the global deformation quantity ofthe average line width is added to each deformation quantity of the linewidth, which is one of pattern deformation quantities obtained from thewhole inspection-unit-area described in the above-mentioned 4.8 Patterndeformation quantities obtained from the whole inspection-unit-area.

According to this embodiment, by separating the pattern deformationquantities into the global deformation quantities and the localdeformation quantities, the number of defects to be detected can bereduced. As a result, important defects can be detected fully, anddetection of a nuisance defect can be reduced. The nuisance defect isdefined as a defect that is not necessary to be recognized as a defect.

5.12 Method of Correcting Time-Dependence Variation in MeasurementValues of Line Widths

In the case of long-term inspection, an electron beam spot size may bevaried gradually. The wider electron beam spot size is, the largermeasurement value of line width is. This variation is added to theabove-mentioned global deformation quantities of average the linewidths. Therefore, it is necessary to correct the global deformationquantities of the average line widths for canceling a time-dependencevariation in measurement values of line widths.

FIG. 116 is a schematic view showing a variation in electron beam spotsize on a modified figure drawn from FIG. 23. In FIG. 116, although anelectron beam spot size becomes wider gradually, a variation in theelectron beam spot size can be ignored while inspectinginspection-unit-areas in one line. Such a variation in the measurementvalues of the line widths caused by the variation in the electron beamspot size is corrected by the following procedure:

First, inspection-unit-areas to be inspected twice are determined by themethod shown in FIG. 117. Each inspection-unit-area to be inspectedtwice is set for each time range in which the variation in the electronbeam spot size can be ignored. In FIG. 116, time for inspectinginspection-unit-areas in one line corresponds to the time range.Therefore, the inspection-unit-areas to be inspected twice aredetermined as shown in FIG. 117.

Next, the inspection-unit-areas to be inspected twice are inspected inorder to obtain the above global deformation quantities <C_(X)>,<C_(Y)>, <C₄₅>, and <C₁₃₅> of average the line widths, as shown in FIG.117. In this embodiment, the case where the global deformation quantity<C_(X)> of the average line widths in the X direction is used will bedescribed, because calculation procedure of the global deformationquantities <C_(X)>, <C_(Y)>, <C₄₅>, or <C₁₃₅> is the same. In order torepresent the first time inspection and the inspection-unit-area number,the first suffix and the second suffix are used respectively as shown by<C_(X)>_(1,1), <C_(X)>_(1,11) in FIG. 117. The global deformationquantities represent location-dependence quantities, and the globaldeformation quantities representing time-dependence quantities can beignored.

After the first time inspection, all the inspection-unit-areas areinspected as the second time inspection in order to obtain the aboveglobal deformation quantities <C_(X)>, <C_(Y)>, <C₄₅>, and <C₁₃₅> of theaverage line widths, as shown in FIG. 118. In order to represent thesecond time inspection and the inspection-unit-area number, the firstsuffix and the second suffix are used respectively as shown by<C_(X)>_(2,1), <C_(X)>_(2,11) in FIG. 118.

When the inspection-unit-area whose inspection-unit-area number is 1 isinspected, a correction quantity δ<C_(X)>₁ is calculated by thefollowing equation using the global deformation quantity <C_(X)>_(2,1)and the global deformation quantity <C_(X)>_(1,1):δ<Cx> ₁ =<Cx> _(2,1) −<Cx> _(1,1)The obtained correction quantity δ<C_(X)>₁ means a time-dependencecorrection quantity.

The obtained correction quantity δ<C_(X)>₁ is added to each deformationquantity <C_(X)> of the average line width obtained from theinspection-unit-area, whose inspection-unit-area number is from 2 to 10,in order to correct a time-dependence variation. Theinspection-unit-area number 10 means the preceding number of the nextinspection-unit-area number 11, and the next inspection-unit-area is tobe inspected twice.

The above procedure is performed for each of the global deformationquantities <C_(Y)>, <C₄₅>, and <C₁₃₅> of the average line width in thesame manner. These procedures are performed for all theinspection-unit-areas, which are to be inspected twice.

In the case where patterns to-be-inspected made of an ArF resist areinspected by a scanning electron microscope any number of times,patterns to-be-inspected are shrunk gradually. However, according tothis embodiment, this shrinkage can be ignored, because the same portionis inspected only twice. Therefore, the variation in the measurementvalues of the line widths caused by the gradual variation in theelectron beam spot size can be corrected, even if the above patternsto-be-inspected are inspected.

5.13 Defect-Classes Based on Geometrical Information of ReferencePattern, Information of Design Data, or Information of Data Related toDesign Data

The defect-classes are determined by using characteristic quantities ofa defect image by a defect-class determination unit 14 as described inthe above-mentioned 4.7 Method of determining defect-classes based onfeature quantity obtained from image. In addition, these defect-classes,which are determined by using geometrical information of a referencepattern, information of design data, or information of data related todesign data, can be used.

The following items are used as geometrical information of the designdata:

1. Attributes of a reference pattern (line part, corner, end, isolatedpattern, and the like)

2. A proximate line segment, a remote line segment, or the other

3. Line widths (for example, the minimum line width, widths larger thanthe minimum line width and smaller than the minimum line width×1.5,widths not less than the minimum line width×1.5)

The following items are used as information of the design data:

4. Places where a defect is detected (for example, memory part, logicpart, and the like)

5. A cell name of the design data corresponding to the defect. Inaddition, a line segment number of the cell used in defect detection, ora position of the defect on a coordinate system, which describes thecell, can be used as additional information.

6. Attributes of a wiring (ground wiring, clock wiring, and the like) inthe case where these attributes are defined in the design data.

The following item is used as information of data related to the designdata: Here, as information of the data related to the design data, themask data is used.

7. A cell name of the mask data corresponding to the defect. Inaddition, a line segment number of the cell corresponding to the defect,or a position of the defect on a coordinate system, which describes thecell, can be used as additional information.

Further, in addition to the above, as a defect-class that uses thepattern deformation, the following item can be used:

8. Defect size information (for example, six classifications of largedilation, medium dilation, small dilation, large shrinkage, mediumshrinkage, small shrinkage, and the like).

FIG. 119 is a schematic view showing a defect-class that is determinedby the cell name and the line segment number (see the above-mentioned5.). T-shaped two patterns A and B represent cells of memories that havethe same cell name. End parts surrounded by circles have the same shapeof a reference pattern; however, have different shapes of OPC patterns.In this case, a defect A and a defect B are different defects that arecaused by the different OPC patterns. The defect A and the defect Bcannot be classified by the cell name. On the other hand, OPC patternsthat have related to a cause of a defect can be recognized by the linesegment number.

The above defect-classes can be used in combination. FIG. 120 is aschematic view showing defect-classes that are determined by the abovedefect-classes in combination. The defect-classes shown in FIG. 120 arecombinations of the three defect-classes, which are above-mentioned 6, 1and 8.

According to this embodiment, tendencies for defects to be caused can beeasily grasped. Further, a cause of defects can be easily specified.

5.14 Method of Grouping Defects Based on Feature of Reference Patterns

A method of grouping defects based on features of reference patterns,which are used in detection of defects, and neighboring referencepatterns to the used reference patterns can be used. FIGS. 121 through123 are schematic views showing the above method. When a defect isdetected, reference patterns are clipped by a rectangle corresponding tothe neighborhood of a defect location and are memorized. When theinspection is finished, feature quantities are calculated from theclipped reference patterns, and the defects are grouped.

In FIG. 121, a defect location, clipped reference patterns, and theminimum bounding rectangle are shown. The defect location is a center ofthe minimum bounding rectangle. The clipped reference patterns exist ina rectangle corresponding to the neighborhood of the defect location. Asthe feature quantity with regard to the line-shaped patterns, a set of aline width, a line direction, and the number of polygons can be used. Inaddition, a set of a space width, a space direction and the number ofspaces can be used. As other feature quantities, a set of a type of acorner and the number of the corners, a set of a type of an end and thenumber of the ends, or a set of a type of an isolated pattern and thenumber of the isolated patterns can be used. Next, the feature quantityspace that is composed of the above feature quantities is groupedaccording to the cluster analysis. The cluster analysis is one ofclassification methods and is well known in the statistics.

FIG. 122 is a schematic view showing an example of a feature quantityspace. In FIG. 122, a set of 100 nm line width, the vertical direction,and the four line-shaped patterns; a set of 200 nm line width, thevertical direction, and the two line-shaped patterns; and a set of 100nm line width, the horizontal direction, and the four line-shapedpatterns are used as the feature quantities. In this example, threeclipped reference patterns are clearly separated in the feature quantityspace. However, the clipped reference patterns might not necessarily beclearly separated, because it is uncertain whether a pattern located ina boundary is included in a clipped reference patterns or not, due to atiny difference in defect locations. Therefore, the cluster analysisthat can classify objects being similar to each other is required.

For grouping the clipped reference patterns in detail, it is necessaryto subdivide the feature quantities. For an example shown in FIG. 123,it is necessary to use feature quantities having upward and downwardline-shaped patterns and having short and long line-shaped patterns.

According to this embodiment, tendencies for defects to be caused suchas “many defects have been caused at dense patterns which have thinvertical lines” can be easily grasped as a whole. Moreover, the defectcan be classified for every reference pattern of the similar feature.Further, a cause of defects can be easily specified.

5.15 Method of Selecting Defect Image to-be-Registered

The defect-class determination unit 14 outputs a defect image to thedisplay device 5 and the printer 6 through the output unit 13 in stepS328 (see FIG. 25). The defect image means an image of a patternto-be-inspected from which a defect is detected. If the number ofdefects drastically increases, a huge number of defect images must beregistered, and therefore the memory capacity increases. Therefore, thismethod is of no practical use. Therefore, in order to solve thisproblem, the number of maximum registrations of the defect images foreach defect-class is predetermined.

The number of maximum registrations of the defect images for eachdefect-class may be statically determined based on the number of theabove-mentioned 3.3 Recipe data “9. The number of maximum registrationsof defect images”, or may be dynamically variable based on the number ofdefects which have been detected and monitored. For example, the abovedynamic number of maximum registrations for each defect-class may bedetermined as the number that is proportional to the logarithm of thenumber of the detected defects.

A new defect image is registered until the number of registered defectimages becomes equal to the number of the maximum registrations of thedefect images. In the case where the number of the registered defectimages is equal to the number of maximum registrations of the defectimages, whether the new defect image should be registered is determinedaccording to the defect size or other index. If the defect image isjudged registered, a defect image to be deleted is determined, and thendeleted. As an alternative method, random numbers may be used todetermine whether the new defect image is to-be-registered.

According to this embodiment, even if there are many defects having thesame defect-class and there are few defects having other defect-class,much more kinds of images can be registered.

5.16 Method of Selecting Defect to-be-Reinspected

In some cases, an image of a pattern to-be-inspected is reacquired underthe condition of acquiring an image at high magnification different frommagnification at the time of inspection, and is reinspected. Thereinspection is performed in the following procedure:

1. The recipe registration processing described in FIG. 22 is performed.

In step S202 of FIG. 22, an operator inputs the operator inputparameters into the reference pattern generation unit 11 via the inputdevice 4. In the case of reinspection, also the operator inputs theoperator input parameters for reinspection into the reference patterngeneration unit 11 via the input device 4 in step S202. Here, aninspection area, which is one of the image acquisition parameters in theinput parameters for reinspection, is not inputted, because theinspection area is determined in the following step 4.

2. The inspection processing described in FIG. 25 or FIG. 26 isperformed.

3. A defect to-be-reinspected is automatically selected from detecteddefects.

4. The recipe registration processing described in FIG. 22 is performed.

The operator input parameters for reinspection described in theabove-mentioned step 1 are inputted into the reference patterngeneration unit 11, instead of performing step S202. The inspection areais an inspection area for the random inspection. The inspection area,whose center is a position of the defect to-be-reinspected, isautomatically set by using the position of the defect to-be-reinspected.

5. The inspection processing described in FIG. 25 or FIG. 26 isperformed as reinspection.

As described in the above step 4, in the case of reinspection, it isnecessary to select a defect to-be-reinspected automatically from thedetected defects before reinspection. The defect to-be-reinspected maybe selected from the detected defects by thinning out simply. However,defects having the same defect-class that are frequently caused are notnecessarily important, and in some cases, the defects having the samedefect-class that are occasionally caused are required to-be-reinspectedfully. In order to meet this requirement, the number of maximumregistrations of defects to-be-reinspected for each defect-class isdetermined.

As used in the determination of the number of maximum registrations ofthe defect images described in the above-mentioned 5.15 Method ofselecting defect image to-be-registered, the number of maximumregistrations of the defects to-be-reinspected for each defect-class maybe statically determined based on the above-mentioned 3.3 Recipe data“10. The number of maximum registrations of defects to-be-reinspected.”,or may be dynamically variable based on the number of defects which havebeen detected and monitored. For example, the above dynamic number ofmaximum registrations for each defect-class may be determined as anumber that is proportional to the logarithm of the number of thedetected defects.

After inspection is performed, whether a defect should be reinspected ornot is determined based on random numbers. Specifically, all detecteddefects are given random numbers. A defect having a larger random numberis more important. If a larger defect should be reinspected selectively,a random number to which a certain weight is given based on the defectsize information may be used. Further, the weight may be made usingother criteria than the defect size information.

According to this embodiment, the defects having the same defect-classthat have been frequently caused and the defects having the samedefect-class that have been occasionally caused are reinspected fully.

5.17 Method of Displaying Distribution Diagram of Pattern DeformationQuantities Obtained from the Whole Inspection-Unit-Area

As described in steps S328, 5332 (see FIG. 25), the defect informationis outputted to the display device 5 and the printer 6 through theoutput unit 13. If the output unit 13 outputs the defect information asnumerical numbers, a tendency for defects in the entire semiconductordevice to be caused is difficult to be grasped. In order to solve thisproblem, it is necessary to provide a method in which the output unit 13creates a distribution diagram presented by a bitmap, and outputs thecreated distribution diagram to the display device 5 and the printer 6.The distribution diagram is created by transforming the above-mentioned4.8 Pattern deformation quantities obtained from the wholeinspection-unit-area into a gray-scale or pseudo-color bitmap, and bysuperimposing defects.

FIG. 124 shows an example of a distribution diagram that is created bytransforming deformation quantities of the line widths, which are one ofthe pattern deformation quantities obtained from the wholeinspection-unit-area, into a gray-scale bitmap, and by superimposingdefects. A grid part has the largest deformation quantity of the linewidth, a dotted part has the larger deformation quantity, and a blankpart has normal deformation quantity. Black squares show defects. FromFIG. 124, it is recognized that the larger deformation quantity of theline width a part has, the more number of defects in the part is.

Further, as shown in FIG. 124, in the case where the deformationquantity of the line width is displayed, a stepper aberration, patterndeformation being dependent on a location in a wafer, and the like, canbe grasped graphically. For example, if a semiconductor device, whichconstitutes periodical patterns, and which is formed normally, isinspected to obtain a distribution diagram and the distribution diagramis observed, a tendency for line widths in a peripheral part of thedistribution diagram to be larger than a line width in a center part ofthe distribution diagram is grasped. From the tendency, it is understoodthat a peripheral part of the stepper lens has the aberration. Asanother example, if a SoC, which is formed normally, is inspected toobtain a distribution diagram and the distribution diagram is observed,it is understood that line widths for every function block such as amemory or logic have different values.

Moreover, by using the standard deviation of the line widths, a qualityof a semiconductor device can be verified. The standard deviation of theline widths is another quantity of the pattern deformation quantitiesobtained from the whole inspection-unit-area.

According to this embodiment, a cause of defects can be easily specifiedand the quality of the semiconductor device can be verified, because itbecomes easy to recognize tendencies for defects in the entiresemiconductor device to be caused graphically.

5.18 Method of Classifying Measurement Values Based on GeometricalInformation of Reference Pattern, Information of Design Data, orInformation of Data Related to Design Data

In the above-mentioned 5.17 Method of displaying distribution diagram ofpattern deformation quantities obtained from the wholeinspection-unit-area, the example of the distribution diagram using thedeformation quantities of the line widths is described. If the gate linewidths described in the above-mentioned 5.3.1 Method of inspecting gateline width are used as the line widths, a method of displayingdeformation quantities of gate line widths classified by locations canbe performed. As an alternative method of classifying the deformationquantities of the gate line widths, a method of classifying deformationquantities of gate line widths based on gate lengths, the minimumdistances to the nearest pattern, or the like can be used.

FIG. 125 is a schematic view showing a method of classifying gate linewidths based on gate lengths. Two gates in FIG. 125 have the same gateline width W, but have different gate lengths L₁ and L₂. In the casewhere each gate in a semiconductor device is one of these two gates,graphs G₁ and G₂ in FIG. 125 are obtained from deformation quantities ofall the gate line widths. The graphs G₁ shows distribution of thedeformation quantities of the gate line widths of the gates having thegate length L₁; and the graphs G₂ shows distribution of the deformationquantities of the gate line widths of the gates having the gate lengthL₂.

These graphs should be ideally identical, however, actually aredifferent in general. By investigating a cause of the difference amongthese graphs, it becomes possible to improve quality of thesemiconductor device.

In this embodiment, the method of classifying measurement values basedon geometrical information of reference pattern is described by usingthe gate lengths or the minimum distances to the nearest pattern asgeometrical information. However, a method of classifying measurementvalues based on one of the following information as geometricalinformation of reference pattern can be used:

1. Attributes of a reference pattern (line part, corner, end, isolatedpattern, and the like)

2. A proximate line segment, a remote line segment, or other segments

3. Line widths (for example, the minimum line width, widths larger thanthe minimum line width and smaller than the minimum line width×1.5,widths not less than the minimum line width×1.5)

Further, the above geometrical information can be used in combination.

In addition, instead of using geometrical information of the referencepattern, information of design data, or information of data related todesign data can be used. For example, a cell name of design data or cellname of mask data can be used.

According to this embodiment, for improving quality of the semiconductordevice, it can be realized that all the gate widths in a semiconductordevice are measured, the measured gate widths are classified based onthe gate lengths, the minimum distances to the nearest pattern, or thelike, and the gate widths are analyzed.

5.19 Deformation Quantity of Pattern Exposed by Shaped Beam

In order to write a photomask pattern by using an electron beam maskwriter or a laser beam mask writer, there is a method in which a shapedbeam such as a rectangular beam is used for exposure. In addition, awafer direct writer by using an electron beam uses the same manner. Inthis embodiment, an example, in which a rectangular beam is used forexposing a rectangle, will be described. FIG. 126 is a schematic viewshowing rectangles, which are used in a writer, obtained by dividing aphotomask pattern. Four rectangles R_(beam) are exposed in order towrite a photomask pattern R_(mask), which is a rectangle extending inthe vertical direction, shown in FIG. 126. The exposed patternsfabricated by rectangles R_(beam) constitute a pattern to-be-inspected.

The shaped beam is deformed and exposed, so that a photomask pattern maybe deformed more than an allowable pattern deformation quantity.Conventionally, deformation of the shaped beam is controlled by exposinga test pattern before writing a photomask pattern of a product. However,there has not been a method in which a variation in the shaped beam,which is deformed during the exposure of the photomask pattern of theproduct, is controlled.

In order to solve this problem, the following method is used. In thismethod, the second edges of an image of a pattern to-be-inspectedobtained from a photomask pattern corresponding to the rectanglesR_(beam) used in the writer are obtained, and deformation quantities ofexposed patterns fabricated by the rectangles R_(beam) used in thewriter are obtained by using the obtained second edges. FIG. 127 is aschematic view showing the second edges of an image of a patternto-be-inspected corresponding to the rectangle used in the writer. Thesecond edges E_(L) and E_(R) shown in FIG. 127 represent shapes of theleft-hand side and the right-hand side of exposed patterns fabricated bythe rectangles R_(beam) used in the writer.

The deformation quantities of the exposed patterns are obtained,assuming that the edges of the exposed patterns fabricated by therectangles R_(beam) used in the writer form quadrilaterals.Specifically, a line L_(L) shown in FIG. 127 is obtained byapproximating coordinate values of the second edges E_(L) using theleast square method. A line L_(R) shown in FIG. 127 is obtained from thesecond edges E_(R) by the same manner. It is understood that therectangles R_(beam) used in the writer shown in FIG. 127 have beenexposed by a rectangle beam inclined clockwise. Further, it isunderstood that a gap G shown in FIG. 127 has been caused by therectangle beam inclined clockwise.

Distances between the line L_(L) and the second edges E_(L), anddistances between the line L_(R) and the second edges E_(R) areobtained, and then local deformation quantities of the exposed patternsfabricated by the rectangles R_(beam) used in the writer can beobtained. A location P_(bump) shown in FIG. 127 has the larger localdeformation quantity than other parts. Edge roughness of a partcorresponding to the line L_(L) is larger than edge roughness of a partcorresponding to the line L_(R). In the above method, the edges of theexposed patterns fabricated by the rectangles R_(beam) used in thewriter have been assumed to form quadrilaterals. However, another shape,for example, four connected circular arcs of shown in FIG. 128, may beused.

According to this embodiment, an electron beam mask writer can beevaluated and controlled by obtaining deformation quantities of exposedpatterns fabricated by a pattern used in a writer.

6. Other Scan Methods of Image Generation Device

Instead of scan methods described in the above-mentioned 2.2 Scanmethods of image generation device, the following scan methods can beused in the image generation device 7.

6.1 Method of Scanning Electron Beam in 18 Degrees, Method of ScanningHexagonal Area, and Method of Automatically Determining ScanningConditions Based on Reference Pattern

FIGS. 129A and 129B schematically show a method of scanning an electronbeam in 18 degrees. FIG. 129A shows patterns P1, P2 which are identicalto those shown in FIG. 11A. More than 99% of edges of an image ofpattern to-be-inspected on semiconductor integrated circuits (LSI) orliquid crystal panels have the horizontal direction, vertical direction,the 45 degree direction, or the minus 45 degree direction. In order togive as large angles as possible between all the directions of the edgesand a scanning direction, the scanning direction of the 18 degrees shownin FIG. 129B can be used. If such a scanning direction is used, edgedetection accuracies with regard to almost all the edges becomerelatively high.

The scanning direction of 18 degrees is used in consideration of the 30degree direction of edges of an image of a pattern to-be-inspected. Inthe case of ignoring inspection of edges having the 30 degree direction,the 22.5 degree or arc tangent (2) degree direction shown in FIG. 14 maybe used. Further, angles obtained by adding a multiple of 45 degrees tothese angles can be used.

FIGS. 130A through 130D are schematic views showing a method of scanninga hexagonal area. A conventional scanning electron microscope such as aCD-SEM or the like generally acquires a square image with horizontalscanning lines. However, because of limitations on design of a scanningelectron microscope, an area that can be scanned free of distortions isa circular area 400. Therefore, as shown in FIG. 130A, it is customaryfor a scanning electron microscope to scan a square area 401 boundingthe circular area 400. The circular area 400 contains areas, which canbe scanned free of distortions but are not scanned, in the upper part,the lower side, the left side, and the right side of the square area401. Therefore, these parts are wasted in order to scan a larger area.In this case, for inspecting an inspection area, nine overlapping squareareas B1 through B9 shown in FIG. 130B are scanned.

In the case of scanning a hexagonal area 402 bounding the circular area400 in the lower side of FIG. 130C, the wider area can be scanned,because the scanning area approximates to the circular area 400. Thehexagonal area 402 can be scanned in the following two methods:

As the first method, a method in which the hexagonal area 402 is scannedfully inside but not outside, as shown on the left-hand side of FIG.130C can be used. As the second method, a method in which a rectangleregion containing the hexagonal area 402 is scanned, and the upperright, the lower right, the upper left, and the lower left triangularareas around the hexagonal area 402 within the rectangle region are notused for inspection, as shown on the right-hand side of FIG. 130C can beused. By using these methods, in order to scan the same area as theinspection area shown in FIG. 130B, hexagonal areas B1 through B7 arescanned as shown in FIG. 130D, and therefore the number of scanning canbe reduced.

FIG. 131 is a schematic view showing methods of automatically settingscanning conditions based on a reference pattern. As the methods ofautomatically setting scanning conditions, the following methods can beused:

1. A method of omitting scan area, in the case where no patternto-be-inspected exists in a block like a block (D)

2. A method of setting scanning conditions depending on a line width ofa pattern to-be-inspected

A line width of patterns Pa to-be-inspected in a block (A) is a half ofa line width of patterns Pb to-be-inspected in a block (B). In the caseof inspecting a variation ratio of a line width of a patternto-be-inspected, a magnification of scanning the block (A) is set to adouble of a magnification of scanning the block (B).

3. A method of setting a scanning direction depending on directions ofline segments of reference patterns

Because patterns Pa to-be-inspected in the block (A) have the horizontaland the vertical line segments, the block (A) is scanned once in ascanning direction of 45 degrees, and because patterns Pcto-be-inspected in a block (C) have the 45 degrees and 135 degrees linesegments, the block (C) is scanned twice in scanning directions of 45degrees and 135 degrees.

According to this embodiment, the pattern to-be-inspected may be scannedwith a minimum electron beam (charged particle beam), and therefore theimage of the pattern to-be-inspected can be obtained in a minimum time.In addition, the scanning area can be wider in maximum, and thereforethe number of scanning can be reduced. Further, for preventing edgedetection accuracy, which depends on a scanning direction, fromreducing, an optimal scanning direction can be set by using thereference patterns.

6.2 Scanning Paths of Electron Beam in Image Generation Device

FIGS. 132 and 133 show scanning paths for an electron beam. Anoscillator 410, a counter 411, an X-deflection generating circuit 412, aY-deflection generating circuit 413 are components of the deflectioncontroller 318 as shown in the upper sides of FIGS. 132 and 133. Thecontrol computer 350 sets a start voltage, an end voltage, a stepvoltage to the X-deflection generating circuit 412, and the Y-deflectiongenerating circuit 413. The control computer 350 sends a start signal tothe oscillator 410.

In a conventional scanning, a pattern to-be-inspected is scannedstepwise in each pixel by deflection in the X direction and scannedstepwise in each line by deflection in the Y direction. According tosuch a conventional scanning process, edge detection accuracy is liableto be low because no information may be acquired between scanning lines.According to this embodiment, as shown in FIG. 132, in order to acquireinformation between scanning lines, a signal having amplitude, such as asine-wave signal, is added to deflection in the Y direction foracquiring data between the scanning lines (see the lower left side ofFIG. 132).

As shown in FIG. 132, data at four points are sampled (see the lowerright side of FIG. 132). In this method, spread data for deflection inthe Y direction can be acquired in one period of the sine wave. The datafrom the four points are added and transmitted as one-pixel informationto the control computer 350.

As shown in the upper side of FIG. 132, the oscillator 410 having aninternal frequency, which is four times an output frequency, isconnected to a counter 411. The counter 411 is connected to theX-deflection generating circuit 412 and the Y-deflection generatingcircuit 413. The above circuit arrangement generates a stepwise waveformthat increases in the rightward direction for deflection in the Xdirection, and a sine wave for deflection in the Y direction, based onthe internal frequency. Data at the four points are sampled according tothe internal frequency, and added into sampling data corresponding to apixel.

As an alternative method, a method in which the waveform for deflectionin the Y direction is generated by using the above method and a waveformfor deflection in the X direction is generated as a stepwise waveform inorder to obtain a zigzag scanning path can be used. FIG. 133 shows anexample of the above method.

FIG. 134 schematically shows the filtering of a vertical scan. Pixels Aare close to each other in the horizontal direction and are smoothed bya photomultiplier and an operational amplifier in the secondary electrondetector 330. Pixels B are close to each other in the verticaldirection, but are not smoothed. Therefore, the smoothing filter isapplied vertically to reduce difference between image qualities in thehorizontal and vertical directions. In FIG. 134, the simplest filteringcoefficients are illustrated. However, optimal filtering coefficientsmay be selected to match horizontal frequency characteristics.

According to this embodiment, the difference between the image qualitiesin the X and Y directions can be reduced to the utmost by changingscanning paths in order to acquire information between scanning lines,or filtering.

6.3 Method of Scanning Only Neighboring Portion of Edges of Patternto-be-Inspected

It is necessary to shorten image-acquisition time by using a method ofscanning only a neighboring portion of edges of a patternto-be-inspected. Further, it is necessary to improve edge detectionaccuracy by scanning an electron beam in direction perpendicular todirection of an edge of a pattern to-be-inspected.

FIG. 135 is a schematic view showing a method of scanning only aneighboring portion of edges of a pattern to-be-inspected, and FIG. 136is a flowchart showing procedure in the method of scanning only aneighboring portion of edges of a pattern to-be-inspected. The circuitarrangement shown in FIG. 135 includes an auxiliary deflectiongenerating circuit 450, a rotation circuit 451, an X main deflectioncircuit 452, and a Y main deflection circuit 453.

The method in which only a neighboring portion of edges of a patternto-be-inspected is scanned is performed in the following procedure:

1. A profile acquisition section that is used for detecting the secondedge is obtained from a reference pattern, and information with regardto the profile acquisition sections are registered beforehand. Theinformation includes positions of the middle point, directions, andlengths of the profile acquisition section.

2. The control computer 350 reads the information with regard to thesingle profile acquisition section.

3. The control computer 350 sets the position of the middle point of theprofile acquisition section to the X main deflection generating circuit452 and the Y main deflection generating circuit 453, thereby moving acentral position of a beam.

4. A scan rotation angle corresponding to the direction of the profileacquisition section is set to the rotation circuit 451, and amplitudecorresponding to the length of the profile acquisition section is set tothe auxiliary deflection generating circuit 450.

5. A start signal is sent to the oscillator 410, and the counter 411connected to the oscillator 410 generates a scanning waveform in the Xand Y directions. The outputs of the X main deflection generatingcircuit 452 and the Y main deflection generating circuit 453 are addedin order to generate a scanning path shown in the upper central part ofFIG. 135.

6. The scanning path is then sampled at seven points as shown in theupper right side of FIG. 135 in order to obtain sampling data.

FIGS. 137A and 137B are schematic views showing methods of sequencingacquisition of sampling data when only the neighboring portion of theedges of the pattern to-be-inspected is scanned. As the first method ofsequencing the acquisition of the sampling data, a method in which thesampling points are sampled by skipping according to a skipping rate asshown in FIG. 137A can be used. As the second method of sequencing theacquisition of the sampling data, a method in which the sampling pointsare sampled randomly according to random numbers as shown in FIG. 137Bcan be used. According to the methods, deformation of the profiles dueto the electrification phenomenon of a specimen can be effectivelyreduced, and therefore the methods are suitable for inspectinginsulation. If the electrification phenomenon of a specimen can beignored, the sampling points can be sampled successively in order to goaround the reference pattern.

According to this embodiment, the scanning can be performed at highspeed and edge detection accuracy can be improved. Moreover, theelectrification phenomenon effect can be reduced.

6.4 Method of Scanning Only Neighboring Portions Corresponding to Regionfor Region Inspection Method

In the case of using the above-mentioned 5.2 Region inspection method,by using a method of scanning only neighboring portions corresponding toa region for the region inspection, image-acquisition time can beshortened. Further, edge detection accuracy can be improved because ascanning direction and a direction of an edge of a patternto-be-inspected are perpendicular to each other.

FIGS. 138A, 138B and 138C are schematic views showing a method ofobtaining neighboring portions corresponding to regions for the linewidth inspection. By the following procedure, the neighboring portionscorresponding to the regions for the region inspection shown in FIG.138B or FIG. 138C is obtained, and the obtained portion are scanned.

1. Reference patterns K suitable for the line width inspection areobtained. The rectangles K are shown by solid lines and double lines inFIG. 138A, and are the same as the reference patterns A and thereference patterns B in FIG. 84.

2. The minimum rectangles including profile acquisition sectionsrequired for detecting all second edges based on the reference patternsK are obtained as scanning portions.

Specifically, the minimum rectangle R including the reference patterns Kis obtained. The profile acquisition sections are set to a right linesegment and a left line segment of the rectangle R, respectively.

In FIG. 138B, rectangles Sa and Sb, which are obtained by moving theright line segment and the left line segment of the rectangle R by alength L of the profile acquisition section in the outward direction ofthe reference patterns K, become the scanning portions. The scanningportions are shown by rectangles with four arrows, and the arrows showscanning directions.

In FIG. 138C, a rectangle Sc, which is obtained by dilating therectangle R by the length L of the profile acquisition section, becomesa scanning portion. This method is advantageous in that although both ofthe right and left edges of the pattern to-be-inspected cannot bescanned from the inward to the outward of the pattern, the scanningregion is single.

The scanning region in the space width inspection may be determined inthe same manner.

According to this embodiment, image-acquisition time can be shortened.Further, the edge detection accuracy can be improved because thescanning direction and the direction of the edge of the patternto-be-inspected are perpendicular to each other.

6.5 Method of Performing Interlace Scan and Image-Accumulation ScanUsing Continuously Moving Stage

In order to improve inspection speed, a method in which an image of apattern to-be-inspected is acquired by using a continuously moving stageand a line-sensor is used. However, by using the method, an image of apattern to-be-inspected cannot be acquired by performing interlace scanor image-accumulation scan. The image accumulation scan means scan, inwhich the same scanning line is scanned two or more times in order toacquire an accumulated image.

In order to solve this problem, a method of performing interlace scanand image-accumulation scan using a continuously moving stage andfeedback of a stage position to deflectors, as shown in FIG. 139, isused. FIG. 139 is the same as FIG. 132 except for the following items:

1. In order to control continuous moving, the XY stage controller 322monitors X and Y positions of the XY stage 321, and adjusts a speed ofthe XY stage 321.

2. The XY stage controller 322 gives feedbacks of the X and Y positionsof the XY stage 321 to the X-deflection generating circuit 412 and theY-deflection generating circuit 413.

3. Although in FIG. 132 the counter 411 outputs signals for generating ascanning waveform in the X and Y directions with regard to one field ofview, in FIG. 139 the counter 411 outputs signals for generating ascanning waveform in the X and Y directions with regard to sequentialfields of view.

4. The X-deflection generating circuit 412 and the Y-deflectiongenerating circuit 413 subtract the X and Y positions of the XY stage321, which are obtained from the XY stage controller 322, from thesignals, which are outputted from the counter 411 for generating thescanning waveform in the X and Y directions with regard to sequentialfields of view, and output the results of the above subtractions to theX deflector 313 and the Y deflector 314.

6.5.1 Method of Performing Interlace Scan Using Continuously MovingStage

Interlace scan at 45 degrees in the lower left direction by using theconfiguration shown in FIG. 139, as shown in FIG. 140, will beconsidered. Here, the following symbols are used:

-   -   Sp: an interval between scanning lines    -   Ls: a length of a scanning line in the X direction    -   Ni: the number of scanning lines between a scanning line L₁ and        a scanning line L₂. In this embodiment, the number of scanning        lines Ni is two.    -   Nc: the number of scanning lines that have been scanned from the        scanning line L₁ to the scanning line L₅, which is the next        scanning line of the scanning line L₁. In this embodiment, the        number Nc of scanning lines is four.

A parallelogram region is scanned by the scanning line from L₁ to L₈,and an image of a pattern to-be-inspected is acquired.

FIG. 141 is a schematic view showing scanning waveforms generated by theX deflector 313 and the Y deflector 314, the XY stage 321 continuouslymoving a specimen downward, in the case of performing the interlace scanshown in FIG. 140. The boundaries A, B, C, and F in FIG. 141 showpositions represented by the coordinates describing the scanningwaveforms.

In order to scan a scanning line L₄, the Y deflector 314 should scan theboundary F in the Y direction, in order to scan a scanning line L₅, theY deflector 314 should scan the boundary B in the Y direction, and inorder to scan at 45 degrees in the lower left direction, the Y deflector314 should scan the boundary C in the Y direction. Here, movement of thespecimen during scanning is ignored for simple drawing, therefore it isnecessary to enlarge the boundary C by a movement amount Sp, which isthe same as the interval Sp between scanning lines. Summing up the aboveamounts, the Y deflector 314 should scan a width (2(Ni−1)(Nc−1)+1)Sp inthe Y direction.

The image acquisition device 317 stores intensities of secondaryelectrons detected by the secondary electron detector 330 to a framebuffer shown in FIG. 142. Stored positions of the frame buffercorrespond to the scanning lines shown in FIG. 141. When the detectedintensities to be outputted as one image have been stored in the framebuffer, the image acquisition device 317 outputs the detectedintensities to the inspection unit 12 through the control computer 350.Rectangles I₁ and I₂ in FIG. 142 show intensities to be outputted as oneimage.

6.5.2 Method of Performing Image-Accumulation Scan Using ContinuouslyMoving Stage

An image-accumulation scan at 45 degrees in the lower left direction byusing the configuration shown in FIG. 139, as shown in FIG. 143, will beconsidered. Here, the following symbols are used:

-   -   Sp: an interval between scanning lines.    -   Ls: a length of a scanning line in the X direction.    -   Na: the number of image-accumulation. In this embodiment, the        number Na of image-accumulation is two.

A parallelogram region is scanned by the scanning line from L₁ to L₈,and an image of a pattern to-be-inspected is acquired. The scanninglines L₁ and L₅ are the same scanning line; similarly the scanning linesL₂ and L₆, the scanning lines L₃ and L₇, and the scanning lines L₄ andL₈ are the same respectively.

FIG. 144 is a schematic view showing scanning waveforms generated by theX deflector 313 and the Y deflector 314, the XY stage 321 continuouslymoving a specimen downward, in the case of performing theimage-accumulation scan shown in FIG. 143. The boundaries A, B, C, and Fin FIG. 144 show positions represented by the coordinates describing thescanning waveforms.

In order to scan a scanning line L₄, the Y deflector 314 should scan theboundary F in the Y direction, in order to scan a scanning line L₅, theY deflector 314 should scan the boundary B in the Y direction, and inorder to scan at 45 degrees in the lower left direction, the Y deflector314 should scan the boundary C in the Y direction. Here, movement of thespecimen during scanning is ignored for simple drawing, and therefore itis necessary to enlarge the boundary C by the movement amount Sp, whichis the same as the interval Sp between scanning lines. Summing up theabove amounts, the Y deflector 314 should scan a width (2·Nc/Na·Sp) inthe Y direction.

The image acquisition device 317 adds intensities of secondary electronsdetected by the secondary electron detector 330 to a frame buffer shownin FIG. 145. Stored positions of the frame buffer correspond to thescanning lines shown in FIG. 144. A line (L₁,L₅) in FIG. 145 showspositions of the frame buffer to which intensities of secondaryelectrons detected by scanning the scanning lines L₁ and L₅ are added,and a line (L₂,L₆) shows positions of the frame buffer to whichintensities of secondary electrons detected by scanning the scanninglines L₂ and L₆ are added.

When all the detected intensities to be outputted as one image have beenadded to the frame buffer, the image acquisition device 317 divides theadded intensities by the number of image-accumulation Na and outputs thedivided intensities to the inspection unit 12 through the controlcomputer 350. A rectangle I₃ in FIG. 145 shows intensities to beoutputted as one image.

According to this embodiment, an image of a pattern to-be-inspected canbe acquired by performing interlace scan and image-accumulation scan,using a continuously moving stage and feedback of XY stage positions todeflectors. Consequently, inspection speed can be improved.

7. Method of Correcting Image of Pattern to-be-Inspected

7.1 Method of Correcting at Least One of Reference Pattern and Image ofPattern to-be-Inspected by Detecting Distortion Quantities of Image ofPattern to-be-Inspected

A rotation of the specimen caused by stage moving or the like may causea rotation of an image of a pattern to-be-inspected. Moreover, theelectrification phenomenon of the specimen or the like may causedistortion of the image of the pattern to-be-inspected such as arotation including a skew or a variation in magnification or the like.Because of the above distortion of the image of the patternto-be-inspected, a fine defect smaller than the above distortionquantities of the image of the pattern to-be-inspected cannot bedetected. The above distortion of the image of the patternto-be-inspected occurs sporadically, and the above distortion cannot bepredicted. Therefore, it is necessary to detect the above distortionquantities of the image of the pattern to-be-inspected, and correct theimage of the pattern to-be-inspected every time when an image isacquired.

FIG. 146 is a schematic view showing an image of a patternto-be-inspected having the above distortion. Line segments shown bydotted lines schematically show a reference pattern, and tips of vectorsd(x,y) schematically show edges of an image of a patternto-be-inspected. The matching between the reference pattern and theedges of the image of the pattern to-be-inspected is performed. However,in the matching using only translation, distortion such as a rotation, avariation in magnification or the like remains as matching errors.

First, these matching errors are summed up by using the affinetransformation. The affine transformation means the lineartransformation using the coefficients ‘a’ to ‘f’.X=ax+by+cY=dx+ey+f

In this transformation equation, (x,y) are coordinate values of a pointon the reference pattern, and (X,Y) are coordinate values of an edge ofan image of a pattern to-be-inspected corresponding to the above point.The coefficients ‘a’, ‘b’, ‘d’, and ‘e’ represent a rotation including askew and a variation in magnification. If it is not necessary to correctthe skew, the following matrix is restricted to be an orthogonal matrix:

$\begin{pmatrix}a & b \\d & e\end{pmatrix}\quad$

In addition, if it is not necessary to correct the variation inmagnification, the matrix is restricted to be a rotational matrix.

In this transformation equation, the coefficients ‘c’ and ‘f’ representshift quantities. In the example shown in FIG. 146, these shiftquantities are zero.

The method in which the matching using a sub-inspection-unit-area isperformed is shown in FIG. 147. The sub-inspection-unit-area is definedas an area made by dividing an inspection-unit-area. In the case wherethe inspection-unit-area is huge, the matching using thesub-inspection-unit-area is exceedingly faster than the matching usingthe inspection-unit-area. In this case, the coefficients ‘c’ and ‘f’ ofother sub-inspection-unit-areas are not zero in general.

The coefficients ‘a’ to ‘f’ are calculated by the following procedure:

1. The vector d(x,y) which represents a summation of a patterndeformation quantity and the distortion quantity of the image of thepattern to-be-inspected (shown in FIG. 146) is obtained. The vectord(x,y) is the same as the vector d(x,y) between the two edges shown inFIG. 60.

2. The coefficients ‘a’ to ‘f’ are obtained from(d_(x)(x_(i),y_(i)),d_(y)(x_(i),y_(i)))(‘i’ is a number from 1 to thenumber of data), which are components of the respective vectors d(x,y),by using the least square method. (x_(i),y_(i)) are coordinate values ofthe point of the reference pattern.(x_(i)+d_(x)(x_(i),y_(i)),y_(i)+d_(y)(x_(i),y_(i))) are coordinatevalues of the edge of the image of the pattern to-be-inspectedcorresponding to the above point. Therefore, a summation E of squareerrors of data is calculated by the following equation:E=Σ(x _(i) +d _(x)(x _(i) ,y _(i))−(ax _(i) +by _(i) +c))²+Σ(y _(i) +d_(y)(x _(i) ,y _(i))−(dx _(i) +ey _(i) +f))²where Σ means summation for all ‘i’.

The least square method requires that partial derivatives of thesummation E of square errors of data with regard to the coefficients‘a’, ‘c’, ‘d’, ‘e’, and f are zero:

${\frac{\partial E}{\partial a} = 0},{\frac{\partial E}{\partial b} = 0},{\frac{\partial E}{\partial c} = 0},{\frac{\partial E}{\partial d}0},{\frac{\partial E}{\partial e} = 0},{\frac{\partial E}{\partial f} = 0}$

The following equations are obtained from these equations:

${\begin{pmatrix}{\Sigma\;{ax}_{i}x_{i}} & {\Sigma\;{by}_{i}x_{i}} & {\Sigma\;{cx}_{i}} & 0 & 0 & 0 \\{\Sigma\;{ay}_{i}y_{i}} & {\Sigma\;{by}_{i}y_{i}} & {\Sigma\;{cy}_{i}} & 0 & 0 & 0 \\{\Sigma\;{ax}_{i}} & {\Sigma\;{by}_{i}} & {\Sigma\; c} & 0 & 0 & 0 \\0 & 0 & 0 & {\Sigma\;{dx}_{i}x_{i}} & {\Sigma\;{ey}_{i}x_{i}} & {\Sigma\;{fx}_{i}} \\0 & 0 & 0 & {\Sigma\;{dx}_{i}y_{i}} & {\Sigma\;{ey}_{i}y_{i}} & {\Sigma\;{fy}_{i}} \\0 & 0 & 0 & {\Sigma\;{dx}_{i}} & {\Sigma\;{ey}_{i}} & {\Sigma\; f}\end{pmatrix}\begin{pmatrix}a \\b \\c \\d \\e \\f\end{pmatrix}} = \begin{pmatrix}{{\Sigma( {x_{i} + {d_{x}( {x_{i},y_{i}} )}} )}x_{i}} \\{{\Sigma( {x_{i} + {d_{x}( {x_{i},y_{i}} )}} )}y_{i}} \\{\Sigma( {x_{i} + {d_{x}( {x_{i},y_{i}} )}} )} \\{{\Sigma( {y_{i} + {d_{y}( {x_{i},y_{i}} )}} )}x_{i}} \\{{\Sigma( {y_{i} + {d_{y}( {x_{i},y_{i}} )}} )}y_{i}} \\{\Sigma( {y_{i} + {d_{y}( {x_{i},y_{i}} )}} )}\end{pmatrix}$

The coefficients ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, and ‘f’ are obtained bysolving the above equations. The processing for obtaining thecoefficients ‘a’ to ‘f’ is performed between the step S314 and the stepS318 shown in the flowchart of FIGS. 25 through 27. Hereafter, thisprocessing is called step S316.

The following three methods, in which the image of the patternto-be-inspected is corrected by using the obtained coefficients ‘a’ to‘f’ as shown in FIG. 148, can be performed:

1. Correction Method 1

The reference pattern is corrected by using the coefficients ‘a’ to ‘f’.Then, the step S314 and later steps are performed. However, in thiscase, the step S316 is not performed.

2. Correction Method 2

The edges are detected again after correcting the image of patternto-be-inspected by using the coefficients ‘a’ to ‘f’. In this case, theinvert transformation equations of the equations described in the affinetransformation are used. Then, the step S310 and later steps areperformed. However, in this case, the step S316 is not performed.

3. Correction Method 3

(d_(x)(x_(i),y_(i)),d_(y)(x_(i),y_(i))) which are components of therespective vectors d(x,y) are corrected by the following equation usingthe coefficients ‘a’ to ‘f’:(d_(x)(x_(i),y_(i))−(ax_(i)+by_(i)+c−x_(i)),d_(y)(x_(i),y_(i))−(dx_(i)+ey_(i)+f−y_(i)))

Next, the step S318 is skipped, and the step S320 and later steps areperformed. In the step S320, the obtained corrected vectors d(x,y) areused as the vector d(x,y) between the two edges shown in FIG. 60.

The above-mentioned correction method 1 and the correction method 2 cancorrect the distortion quantities of the image of the patternto-be-inspected accurately. However, they require huge calculating cost.On the other hand, in the above-mentioned correction method 3, althoughthe vectors d(x,y) of corner portions cannot be corrected sufficientlyaccurately, calculating cost is low. This inaccuracy may be ignoredpractically.

Although this embodiment uses the affine transformation, othertransformation can be used. For example, transformation equations usingquadratic terms of x_(i), y_(i) can be used. However, complextransformation equations may ignore actual pattern deformationquantities, and therefore it is necessary to choose transformationequations carefully.

According to this embodiment, the distortion quantities of the image ofthe pattern to-be-inspected are detected as linear values, and the imageof the pattern to-be-inspected is corrected. As a result, the distortionquantities, which should not be detected as a defect, can be ignored sothat false defects can be prevented from being detected.

The above method that detects the rotation including the skew, and thevariation in magnification can be used for rotation and magnificationadjustments of the image generation device 7. The adjustments can beperformed before the inspection or at an appropriate time during theinspection as needed. In this case, the affine transformationcoefficients ‘a’, ‘d’, and ‘e’ are converted into adjustment values ofrotation and magnification of the image generation device 7, and theadjustment values are set to the image generation device 7.

7.2 Method of Accumulating Images by Using Method of Correcting Imagesof Pattern to-be-Inspected

As a method of improving quality of an image of a patternto-be-inspected, the image-accumulation method is well known. However,in the case where images of a pattern to-be-inspected on a specimenliable to cause the electrification phenomenon are acquiredsuccessively, a sharp accumulated image cannot be obtained byaccumulating the acquired images simply, because the acquired images aredistorted gradually.

In order to solve this problem, a method of accumulating images by usinga method of correcting images of a pattern to-be-inspected is used. FIG.149 is a schematic view showing the above method.

In FIG. 149, the above-mentioned Correction method 2 in 7.1 Method ofcorrecting at least one of reference pattern and image of patternto-be-inspected by detecting distortion quantities of image of patternto-be-inspected is used for correcting the acquired images. Next, thecorrected images are accumulated.

According to this embodiment, even if the acquired images, which aredistorted gradually, are accumulated, the sharp accumulated image can beobtained.

7.3 Method of Obtaining Distortion Quantities of Image of Patternto-be-Inspected by Using Distribution of the First Edges of Image ofPattern to-be-Inspected

In the above-mentioned 7.1 Method of correcting at least one ofreference pattern and image of pattern to-be-inspected by detectingdistortion quantities of image of pattern to-be-inspected, thedistortion quantities of the image of the pattern to-be-inspected areobtained by using the vectors d(x,y) between the reference pattern andthe edges of the image of the pattern to-be-inspected. However, in thecase of the large distortion quantities of the image of the patternto-be-inspected, the vectors d(x,y) which exceed the allowable patterndeformation quantity cannot be obtained, and therefore the patterndeformation quantities may not be obtained correctly as shown in FIG.150. In this case, a method of obtaining distortion quantities of theimage of the pattern to-be-inspected by using distribution of the firstedges of an image of a pattern to-be-inspected can be used.

In FIG. 150, reference patterns have mainly the vertical line segments,and the first edges of an image of a pattern to-be-inspected have mainlyangles slightly different from 90 degrees. In this embodiment, the firstedges detected from an image having bright edges and having no contrastbetween the inside of a pattern and the ground as described in 4.1.2 Thefirst edge detection method 2 are used as edges (edge vectors). In thiscase, the edges have an angle from 0 to 180 degrees. An image having acontrast between the inside of the pattern and the ground as describedin 4.1.1 The first edge detection method 1 can be used in the samemanner.

First, rotation correction of the image of the pattern to-be-inspectedis performed in the following procedure:

1. Here, the case where the X and Y components of the edges of the imageof the pattern to-be-inspected have a value from 0 to 15 will beconsidered. In order to obtain an image rotation angle θx with regard tothe edges of the image of the pattern to-be-inspected in the verticaldirection, frequencies F(0,15), F(1,15), and F(−1,15), which correspondto the edges of the image of the pattern to-be-inspected having the Xand Y components (0,15), (1,15), and (−1,15), are obtained. Thesefrequencies are shown in FIG. 151.

2. Ratios R(1) and R(−1) are obtained from the frequencies F(0,15),F(1,15), and F(−1,15):R(1)=F(1,15)/(F(0,15)+F(1,15)+F(−1,15))R(−1)=F(−1,15)/(F(0,15)+F(1,15)+F(−1,15))

It is assumed that F(0,15), F(1,15), and F(−1,15) have the standardnormal distribution. FIG. 151 is a schematic view showing a method ofobtaining a center of the standard distribution. Positions X(1) andX(−1) of the standard normal distribution corresponding to the ratiosR(1) and R(−1) are obtained as shown in FIG. 151. The positions X(1) andX(−1) are distances from the center of the standard normal distribution,and positive numbers. The following position Xc is a center of thedistribution of the frequencies, because the positions X(1) and X(−1)correspond to the X component 0.5 and −0.5 of the edges of the image ofthe pattern to-be-inspected.Xc=X(−1)/(X(1)+X(−1))−0.5

Therefore, the image rotation angle θx with regard to the edges of theimage of the pattern to-be-inspected in the vertical direction is thefollowing:θx=arc tan(Xc/15)

3. In order to obtain an image rotation angle θy with regard to theedges of the image of the pattern to-be-inspected in the horizontaldirection, calculations, which are the same in the above steps 1 and 2with the X components and Y components being inverted, are performed.FIG. 152 is a view showing the image rotation angle θx and θy.

4. The coefficients ‘a’, ‘b’, ‘d’, and ‘e’ of the affine transfer areobtained from the image rotation angles θx and θy as follows:

$\begin{pmatrix}a & b \\d & e\end{pmatrix} = \begin{pmatrix}{\cos\;\theta\; y} & {\sin\;\theta\; x} \\{\sin\;\theta\; y} & {\cos\;\theta\; x}\end{pmatrix}$

Next, magnification correction of the image of the patternto-be-inspected is performed in the following procedure:

5. In order to obtain a magnification Mx of the image of the patternto-be-inspected in the horizontal direction, the vertical line segmentsthat constitute the reference patterns are extracted. The extracted linesegments are projected onto the horizontal axis (the X-axis) to produceone-dimensional data as shown in FIG. 153A. This one-dimensional data isin the form of array, and an index corresponds to an X coordinate valueand an element corresponds to a length of the line segments. (see 4.2.3Matching method in which projection data obtained by projecting edge onthe horizontal and vertical axes are used)

6. Center points of the edges of the image of the patternto-be-inspected having the X and Y components (0,15), (1,15), and(−1,15) are transformed by the coefficients ‘a’ to ‘f’ of the affinetransfer obtained in the above step 4. The coefficients ‘c’ and ‘f’ aretaken so that a center of the transferred image of the patternto-be-inspected is equal to a center of the image of the patternto-be-inspected before transformation. Then the transformed centerpoints of the edges are projected onto the horizontal axis (the X-axis)to produce one-dimensional data as shown in FIG. 153B. Thisone-dimensional data is in the form of array. An index of the arraycorresponds to an X coordinate value, and an element of the arraycorresponds to a Y component of the edge vector corresponding to thetransformed center point of the edge.

The distribution of the obtained projection data of the edges isseparated clearly. However, in the case of performing no rotationcorrection, distribution of projection data of the edges are separatednot clearly. Therefore, the order of the rotation correction andmagnification correction is suitable.

7. In the above-mentioned 4.2.3 Matching method in which projection dataobtained by projecting edge on the horizontal and vertical axes areused, while shifting the projection data of the upward (vertical) edgesonto the horizontal axis within the range of the X direction shown inFIG. 46, the matching error values E_(pm) in the X direction between theprojection data of the upward (vertical) edges onto the horizontal axisand the projection data of upward (vertical) line segments onto thehorizontal axis are calculated. In order to obtain a magnification Mx ofthe image of the pattern to-be-inspected in the horizontal direction,the above calculation is performed for the following plural projectiondata as shown in FIG. 153C.

Each of the plural projection data is obtained from the projection dataof the upward (vertical) edges onto the horizontal axis by the linearapproximation method in order to magnify magnification Mx_(cand) times.The each magnification Mx_(cand) is in a range, in which themagnification Mx is to be obtained, with an interval between themagnifications Mx_(cand) corresponding to an accuracy of themagnification Mx. A matching error value E_(pm) is obtained from theprojection data magnified by each magnification Mx_(cand). The smallestmatching error value E_(pm) is obtained from the obtained matching errorvalues E_(pm). A magnification Mx_(cand) that corresponds to thesmallest matching error value E_(pm) is taken as the magnification Mx ofthe image of the pattern to-be-inspected in the horizontal direction.

8. In order to obtain a magnification My of the image of the patternto-be-inspected in the vertical direction, calculations, which are thesame in the above steps 5 through 7 with the X components and Ycomponents being inverted, are performed.

9. The coefficients ‘a’, ‘b’, ‘d’, and ‘e’ of the affine transfer areobtained from the image rotation angles θx, θy and the magnificationsMx, My as follows:

$\begin{pmatrix}a & b \\d & e\end{pmatrix} = \begin{pmatrix}{M\; x\;\cos\;\theta\; y} & {M\; x\;\sin\;\theta\; x} \\{M\; y\;\sin\;\theta\; y} & {M\; y\;\cos\;\theta\; x}\end{pmatrix}$

10. The image of the pattern to-be-inspected is transformed by thecoefficients ‘a’ to ‘f’ of the affine transfer. The coefficients ‘c’ and‘f’ are taken so that a center of the transferred image of the patternto-be-inspected is equal to a center of the image of the patternto-be-inspected before transformation.

11. By using the obtained image, the above-mentioned correction method 2in 7.1 Method of correcting at least one of reference pattern and imageof pattern to-be-inspected by detecting distortion quantities of imageof pattern to-be-inspected is performed. In this case, the image ofpattern to-be-inspected, which is to be corrected, is not thetransformed image of pattern to-be-inspected in the above step 10, butthe image of pattern to-be-inspected before the transformation.Therefore, the coefficients of the affine transfer to be used in thecorrection method 2 are obtained by multiplying the coefficients of theaffine transfer obtained in the above step 10 by the coefficients of theaffine transfer obtained in the above-mentioned 7.1 Method of correctingat least one of reference pattern and image of pattern to-be-inspectedby detecting distortion quantities of image of pattern to-be-inspectedas matrix calculation. According to this manner, because the affinetransformation is performed once, quality of an image of a patternto-be-inspected deteriorates less noticeably.

In this embodiment, the case where the X and Y components of the edgesof the image of the pattern to-be-inspected have a value from 0 to 15has been considered. For requiring higher accuracy, the X and Ycomponents of the edges of the image of the pattern to-be-inspected mayhave a larger value than 15. Further, in the case where the imagerotation angle θx or θy has a large number, the edges of the image ofthe pattern to-be-inspected having other X and Y components, for example(2,15) and (−2,15), are used, besides the X and Y components (0,15),(1,15), and (−1,15).

According to this embodiment, even if the vectors between the referencepattern and the edges of the image of the pattern to-be-inspected maynot be obtained necessarily due to large distortion quantities of theimage of the pattern to-be-inspected, the distortion quantities of theimage of the pattern to-be-inspected can be obtained, and then the imageof the pattern to-be-inspected can be corrected. Especially, thisembodiment is efficient for the case of inspecting a specimen liable tocause the electrification phenomenon drastically and the case ofrotation and magnification adjustments of the image generation device 7.

7.3.1 Method of Obtaining Distribution of the First Edges of Line Partof Image of Pattern to-be-Inspected

In the above-mentioned 7.3 Method of obtaining distortion quantities ofimage of pattern to-be-inspected by using distribution of the firstedges of image of pattern to-be-inspected, it is assumed thatdistribution of the first edges of corner parts of an image of a patternto-be-inspected is symmetry. FIG. 154 is a schematic view showing anexample in which distribution of the first edges of corner parts of animage of a pattern to-be-inspected is asymmetry. Distribution of thefirst edges in part A of FIG. 154 is symmetry, however, distribution ofthe first edges in part B of FIG. 154 is asymmetry and biased towardupper left direction. The asymmetry affects accuracy of obtaining theabove distortion quantities of the image of the pattern to-be-inspected.In order to solve the problem, the distribution of the first edges fromthe first edges that exist in line parts of the image of the patternto-be-inspected is obtained.

FIG. 155 is a schematic view showing a method of recognizing the firstedges that exist in corner parts of an image of a patternto-be-inspected. Open circles in FIG. 155 mean the first edges of animage of a pattern to-be-inspected. The first edges of the image of thepattern to-be-inspected are linked. As a method of linking, a methoddisclosed in the literature [reference 2]: Cartan Steger, “An unbiaseddetector of curvilinear structures,” IEEE Trans. Pattern Anal. MachineIntell., Vol. 20, No. 2, February 1998, or the like can be used.

Next, the linked first edges are approximated by a polygon. As a polygonapproximation method, Ramer's method is used. First, the first edge Athat exists in the lower left-hand side and the first edge B that existsin the upper right-hand side are obtained. The obtained first edges Aand B are registered as vertices of the polygon. Next, the first edge C,which has the longest distance Dc from a line segment AB in the firstedges existing between the first edge A and the first edge B, isobtained. In the case where the distance Dc from the line segment AB tothe first edge C is longer than the predetermined distance D1, the firstedge C is registered as a vertex of the polygon. In the same manner, thefirst edge D, which has the longest distance Dd from a line segment BAin the first edges existing between the first edge B and the first edgeA, is registered as a vertex of the polygon. The above procedure isiterated until it becomes impossible to register a vertex. Thepredetermined distance D1 is determined in consideration of noise.

Next, the first edges corresponding to the obtained vertices, and thefirst edges that exist in the neighborhood of the first edgescorresponding to the obtained vertices are recognized as the first edgesexisting in corner parts of the image of the pattern to-be-inspected.The number Nn of vertices, which exist in the neighborhood of the firstedges corresponding to the obtained vertices, is determined inconsideration of corner roundness. The first edges except for the firstedges existing in corner parts are recognized as the first edgesexisting in line parts of the image of the pattern to-be-inspected. FIG.156 is a schematic view showing a method of recognizing the first edgesthat exist in line parts of the image of the pattern to-be-inspected. InFIG. 156, the case where the number Nn of vertices, which exist in theneighborhood of the first edges corresponding to the obtained vertices,is one is shown. Vertices, which exist in the neighborhood of the firstedges corresponding to the obtained vertices, is shown by solid circles(●). The distribution of the first edges is obtained from the firstedges that exist in the line parts of the image of the patternto-be-inspected.

According to this embodiment, because the distribution of the firstedges is obtained from the first edges which exist in a line part of theimage of the pattern to-be-inspected, even if distribution of the firstedges of corner parts of the pattern to-be-inspected is asymmetry, it ispossible to prevent deterioration of accuracy of obtaining thedistortion quantities of the image of the pattern to-be-inspected thatis caused by the asymmetry.

7.4 Method of Correcting Nonlinear Distortion of Image

The image generation device 7 with a large field of view may havedistortions of an image of a pattern to-be-inspected that cannot becorrected by the affine transformation used in 7.3 Method of obtainingdistortion quantities of image of pattern to-be-inspected by usingdistribution of the first edges of image of pattern to-be-inspected. Thedistortions of the image of the pattern to-be-inspected are caused bySeidel's five aberrations. One of the most important distortions of theimage of the pattern to-be-inspected is a nonlinear distortion of theimage. In order to correct the nonlinear distortion of the image, amethod shown in FIGS. 157 through 162 can be used.

As shown in FIG. 157, the nonlinear distortion of the image can beignored in a central part of an image of a pattern to-be-inspected, butcannot be ignored in a peripheral part of the image of the patternto-be-inspected. In this method, distortion vectors are obtained fromthe image of the pattern to-be-inspected, the obtained distortionvectors are transformed into representative distortion vectors, and thena distortion correction vector of each scanning point is calculated bythe obtained representative distortion vectors. The distortioncorrection vectors are used in the deflection controller 318 as shown inFIG. 158. FIG. 158 is the same as FIG. 132 except for adding adistortion correction vector calculation circuit 414. The controlcomputer 350 sets the representative distortion vectors to thedistortion correction vector calculation circuit 414. The distortioncorrection vector calculation circuit 414 calculates a distortioncorrection vector in synchronism with a signal from the counter 411.Then, the distortion correction vector calculation circuit 414 outputs Xand Y components of the distortion correction vector to the X-deflectiongenerating circuit 412 and the Y-deflection generating circuit 413.

In FIG. 159, a method in which the distortion correction vectorcalculation circuit 414 calculates the distortion correction vectorusing the representative distortion vectors is shown. FIG. 159 uses an Xdeflection voltage and a Y deflection voltage as the X and Y coordinatesrespectively. The representative distortion vectors are set to locationsshown by solid circles (●) in FIG. 159 for every X directional intervaland for every Y directional interval. These intervals are equal to theabove-mentioned 3.3 Recipe data “12. The interval of representativedistortion vectors held by the distortion correction vector calculationcircuit”. One interval corresponds to a step voltage between scanningpoints. Here, for simple explanation, a method in which the X and Ydirectional intervals are the same interval 8 will be described.

In order to calculate the distortion correction vector C_(d)(x,y) of ascanning point shown in FIG. 159, the following bilinear interpolationequation that uses the representative distortion vectors R_(d) ^([0,0]),R_(d) ^([8,0]), R_(d) ^([0,8]), and R_(d) ^([8,8]) is used:C _(d)(x,y)=[{R _(d) ^([0,0])(8−x)+R _(d) ^([8,0]) x}(8−y)+{R _(d)^([0,8])(8−x)+R _(d) ^([8,8]) x}y]/8²where the (x,y) are scanning point coordinates determined by the counter411. A variable having the suffixes ^([x,y]) means a variablecorresponding to the scanning point coordinates (x,y).

A method in which the representative distortion vectors are calculatedfrom the distortion vectors will be described. First, matching betweenreference patterns and edges of an image of a pattern to-be-inspected isperformed in the central part of the image. The reference patternssuitable for this method are simple patterns arranged periodically asshown by dotted lines in FIG. 157.

In FIG. 160A, a method in which representative distortion vectorslocated at vertices of a rectangle region are calculated from distortionvectors in the rectangle region is shown. In this case, the abovebilinear interpolation method is used in the calculation. FIG. 160A isthe same as FIG. 159, except that the distortion vectors d(x,y) are usedinstead of the distortion correction vectors of the scanning points. Thedistortion vector d(x,y) is defined as a vector whose start point is apoint on a reference pattern, and whose end point is a point of an edgeof the image of the pattern to-be-inspected corresponding to the pointon the reference pattern. The distortion vector d(x,y) is the same asthe vector d(x,y) between the two edges shown in FIG. 60.

This embodiment will use z(x,y) which is an X or Y component of thedistortion vector d(x,y) because calculation procedure of the Xcomponent of the distortion vector d(x,y) and calculation procedure ofthe Y component of the distortion vector d(x,y) are the same. Similarly,r_(z) ^([0,0,]), r_(z) ^([8,0]), r_(z) ^([0,8]), and r_(z) ^([8,8]) willbe used as an X or Y component of the representative distortion vectorsR_(d) ^([0,0]), R_(d) ^([8,0]), R_(d) ^([0,8]), and R_(d) ^([8,8]),respectively. Therefore, z(x,y) is expressed by the following equation:z(x,y)={r _(z) ^([0,0])(8−x)(8−y)+r _(z) ^([8,0]) x(8−y)+r _(z)^([0,8])(8−x)y+r _(z) ^([8,8]) xy}/8²

In order to solve r_(z) ^([0,0]), r_(z) ^([0,8]), r_(z) ^([0,8]), andr_(z) ^([8,8]), the least square method is performed by using sufficientdata (x_(i),y_(i),z_(i)) which exist in the rectangle region. The x_(i),y_(i) mean the X, Y coordinates of the scanning point, and z_(i) meansan X or Y component of the distortion vector d(x,y). Therefore, asummation E of square errors of data is calculated by the followingequation:E=Σ ^([0,0]) [z _(i) −{r _(z) ^([0,0])(8−x)(8−y)+r _(z) ^([8,0])x(8−y)+r _(z) ^([0,8])(8−x)y+r _(z) ^([8,8]) xy}/8²]²where Σ^([0,0]) means summation for all the data in the rectangularregion (P_(s) ^([0,0]), P_(s) ^([8,0]), P_(s) ^([0,8]), P_(s) ^([8,8])).The suffix ^([0,0]) means the suffix ^([0,0]) held by the lower leftpoint P_(s) ^([0,0]), of the rectangle region.

The least square method requires that partial differentials for r_(z)^([0,0]), r_(z) ^([8,0]), r_(z) ^([0,8]), and r_(z) ^([8,8]) of thesummation E of square errors of data should be zero.

${\frac{\partial E}{\partial r_{z}^{\lbrack{0,0}\rbrack}} = 0},{\frac{\partial E}{\partial r_{z}^{\lbrack{8,0}\rbrack}} = 0},{\frac{\partial E}{\partial r_{z}^{\lbrack{0,8}\rbrack}} = 0},{\frac{\partial E}{\partial r_{z}^{\lbrack{8,8}\rbrack}} = 0}$

Therefore, the following equations are established:

$\begin{pmatrix}{\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{00i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{00i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{00i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{00i}} \\{\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{10i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{10i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{10i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{10i}} \\{\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{01i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{01i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{01i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{01i}} \\{\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{11i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{11i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{11i}} & {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{11i}}\end{pmatrix}{\quad{\begin{pmatrix}r_{z}^{\lbrack{0,0}\rbrack} \\r_{z}^{\lbrack{8,0}\rbrack} \\r_{z}^{\lbrack{0,8}\rbrack} \\r_{z}^{\lbrack{8,8}\rbrack}\end{pmatrix} = \begin{pmatrix}{\Sigma^{\lbrack{0,0}\rbrack}k_{00i}z_{i}} \\{\Sigma^{\lbrack{0,0}\rbrack}k_{10i}z_{i}} \\{\Sigma^{\lbrack{0,0}\rbrack}k_{01i}z_{i}} \\{\Sigma^{\lbrack{0,0}\rbrack}k_{11i}z_{i}}\end{pmatrix}}}$where the following symbols are used:k _(00i)=(8−x _(i))(8−y _(i))/8²k _(10i) =x _(i)(8−y _(i))/8²k _(01i)=(8−x _(i))y _(i)/8²k _(11i) =x _(i) y _(i)/8²

By solving the above equations, solutions can be obtained.

As shown in FIG. 160B, a composed distortion vector which is made fromcomposition of the distortion vector d(x,y) obtained by the X componentand the distortion vector d(x,y) obtained by the Y component is notperfectly consistent with a distortion vector at the position. In orderto reduce the inconsistency, the above embodiment should be iterated.The above bilinear interpolation (described in the following equationagain) is linear with regard to r_(z) ^([0,0]), r_(z) ^([8,0]), r_(z)^([0,8]), and r_(z) ^([8,8]). Therefore, r_(z) ^([0,0]), r_(z) ^([8,0]),r_(z) ^([0,8]), and r_(z) ^([8,8]) calculated in the second and latercalculations are added to r_(x) ^([0,0]), r_(z) ^([8,0]), r_(z)^([0,8]), and r_(z) ^([8,8]) calculated in the preceding calculation.Then the obtained r_(z) ^([0,0]), r_(z) ^([8,0]), r_(z) ^([0,8]), andr_(z) ^([8,8]) are used for distortion correction.z(x,y)={r _(z) ^([0,0])(8−x)(8−y)+r _(z) ^([8,0]) x(8−y)+r _(z)^([0,8])(8−x)y+r _(z) ^([8,8]) xy)}/8²

In order to expand this method into a method in which a plurality ofrectangle regions is used, the above calculation is applied to aplurality of rectangular regions. This method will be described by usingan example in which four rectangular regions(P_(s) ^([0,0]),P_(s) ^([8,0]),P_(s) ^([16,0]),P_(s) ^([0,8]),P_(s)^([8,8]),P_(s) ^([16,8]),P_(s) ^([0,16]),P_(s) ^([8,16]),P_(s)^([16,16]))are used as shown in FIG. 161.

First, the above equations will be expressed for simplification asfollows:

$\begin{pmatrix}s_{00}^{00} & s_{10}^{00} & s_{20}^{00} & s_{30}^{00} \\s_{01}^{00} & s_{11}^{00} & s_{21}^{00} & s_{31}^{00} \\s_{02}^{00} & s_{12}^{00} & s_{22}^{00} & s_{32}^{00} \\s_{03}^{00} & s_{13}^{00} & s_{23}^{00} & s_{33}^{00}\end{pmatrix}{\quad{\begin{pmatrix}r_{z}^{\lbrack{0,0}\rbrack} \\r_{z}^{\lbrack{8,0}\rbrack} \\r_{z}^{\lbrack{0,8}\rbrack} \\r_{z}^{\lbrack{8,8}\rbrack}\end{pmatrix} = \begin{pmatrix}s_{0}^{00} \\s_{1}^{00} \\s_{2}^{00} \\s_{3}^{00}\end{pmatrix}}}$

In this equation, the following symbols are used:

$\begin{matrix}{s_{00}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{00i}}} & {s_{10}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{00i}}} & {s_{20}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{00i}}} & {s_{30}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{00i}}} \\{s_{01}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{01i}}} & {s_{11}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{01i}}} & {s_{21}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{01i}}} & {s_{31}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{10i}}} \\{s_{02}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{10i}}} & {s_{12}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{10i}}} & {s_{22}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{10i}}} & {s_{32}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{01i}}} \\{s_{03}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{00i}k_{10i}}} & {s_{13}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}k_{11i}}} & {s_{23}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}k_{11i}}} & {s_{33}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}k_{11i}}} \\{s_{0}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{00i}z_{i}}} & \; & \; & \; \\{s_{1}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{10i}z_{i}}} & \; & \; & \; \\{s_{2}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{01i}z_{i}}} & \; & \; & \; \\{s_{3}^{00} = {\Sigma^{\lbrack{0,0}\rbrack}k_{11i}z_{i}}} & \; & \; & \;\end{matrix}$where the suffixes⁰⁰ means the suffix of Σ^([0,0]).

The summation E of square errors of data in the four rectangle regionsis calculated by the following equation:

$E = {{\Sigma^{\lbrack{0,0}\rbrack}\begin{bmatrix}{z_{i} - \{ {{{r_{z}^{\lbrack{0,0}\rbrack}( {8 - x} )}( {8 - y} )} + {r_{z}^{\lbrack{8,0}\rbrack}x( {8 - y} )} +} } \\{ {{{r_{z}^{\lbrack{0,8}\rbrack}( {8 - x} )}y} + {r_{z}^{\lbrack{8,8}\rbrack}{xy}}} \}/8^{2}}\end{bmatrix}}^{2} + {\Sigma^{\lbrack{8,0}\rbrack}\begin{bmatrix}{z_{i} - \{ {{{r_{z}^{\lbrack{8,0}\rbrack}( {8 - x} )}( {8 - y} )} + {r_{z}^{\lbrack{16,0}\rbrack}x( {8 - y} )} +} } \\{ {{{r_{z}^{\lbrack{8,8}\rbrack}( {8 - x} )}y} + {r_{z}^{\lbrack{16,8}\rbrack}{xy}}} \}/8^{2}}\end{bmatrix}}^{2} + {\Sigma^{\lbrack{0,8}\rbrack}\begin{bmatrix}{z_{i} - \{ {{{r_{z}^{\lbrack{0,8}\rbrack}( {8 - x} )}( {8 - y} )} + {r_{z}^{\lbrack{8,8}\rbrack}x( {8 - y} )} +} } \\{ {{{r_{z}^{\lbrack{0,16}\rbrack}( {8 - x} )}y} + {r_{z}^{\lbrack 816\rbrack}{xy}}} \}/8^{2}}\end{bmatrix}}^{2} + {\Sigma^{\lbrack{8,8}\rbrack}\begin{bmatrix}{z_{i} - \{ {{{r_{z}^{\lbrack{8,8}\rbrack}( {8 - x} )}( {8 - y} )} + {r_{z}^{\lbrack{16,8}\rbrack}x( {8 - y} )} +} } \\{ {{{r_{z}^{\lbrack{8,16}\rbrack}( {8 - x} )}y} + {r_{z}^{\lbrack{16,16}\rbrack}{xy}}} \}/8^{2}}\end{bmatrix}}^{2}}$

Therefore, the following equations are established:

By solving the above equations, solutions can be obtained.

Next, variations in magnification of the image of the patternto-be-inspected in the X direction and the Y direction are obtained fromthe data (x_(i),y_(i),z_(i)) located in the neighborhood of therepresentative distortion vector. In this embodiment, a method in whicha variation quantity a_(mag) of the magnification in the X direction isobtained will be described. A part having the variation quantitya_(mag), which is equal to 1, is observed in the same magnification asthe central part having no nonlinear distortion of the image. A parthaving the variation quantity a_(mag), which is greater than 1, isobserved at higher magnification than the central part having nononlinear distortion of the image. z_(i) is taken as the X component ofthe distortion vector d(x,y), and S_(c) is taken as a shift quantity.Therefore, the following equation is established:x _(i) +z _(i) =a _(mag) x _(i) +S _(c)

In the case where the number of data is not less than three, thisequation should be solved by the least square method. A summation E ofsquare errors of data is:E=Σ(x _(i) +z _(i) −a _(mag) x _(i) −S _(c))²where Σ means summation for all the data (xi, yi, zi), the least squaremethod requires the following equations:

${\frac{\partial E}{\partial a_{mag}} = 0},{\frac{\partial E}{\partial S_{c}} = 0}$

Then, the following equations are obtained by solving the aboveequations.

${{a_{mag}{\sum\limits_{i}x_{i}}} - S_{c}} = {\sum\limits_{i}( {x_{i} + z_{i}} )}$${{a_{mag}{\sum\limits_{i}x_{i}^{2}}} - {S_{c}{\sum\limits_{i}x_{i}}}} = {\sum\limits_{i}{( {x_{i} + z_{i}} )x_{i}}}$

Therefore, the following equation is obtained:

$a_{mag} = \frac{{\sum\limits_{i}{( {x_{i} + z_{i}} ){\sum\limits_{i}x_{i}}}} - {N{\sum\limits_{i}{( {x_{i} + z_{i}} )x_{i}}}}}{{\sum\limits_{i}{x_{i}{\sum\limits_{i}x_{i}}}} - {N{\sum\limits_{i}x_{i}^{2}}}}$where N means the total number of data. The representative distortionvectors are multiplied by the obtained variation quantity a_(mag) inorder to correct the variation in magnification.

FIGS. 162A and 162B show a method in which the distortion correctionvector calculation circuit 414 converts the distortion correction vectorinto a deflection voltage. In FIGS. 162A and 162B, the vertical axisrepresents the X position scanned by an electron beam. The origin of thevertical axis means the center of the image of the patternto-be-inspected. Upper part of the vertical axis means a peripheral partof the image. The horizontal axis is an X deflection voltage. Scalemarkings on the horizontal axis mean voltages that are set to scanningpoints. An interval between the scale markings is a step voltage E_(s)for moving the electron beam by one scanning point in a part that has nononlinear distortion of the image.

A stair-like waveform shown by a dotted line in FIG. 162A is an idealscanning waveform. A stair-like waveform shown by a solid line isscanning waveform having nonlinear distortion of the image. A value ofthe X component r_(z) ^([8,0]) of the representative distortion vectorR_(d) ^([8,0]) is a distance between a start point and an end point. Thestart point is a point on the ideal scanning waveform (shown by thestair-like waveform shown by the dotted line) corresponding to ascanning point. The end point is a point on the scanning waveform havingnonlinear distortion of the image (the stair-like waveform shown by thesolid line) corresponding to the above scanning point. In order tosimplify the drawing, the representative distortion vector R_(d)^([0,0]) at the origin is set to zero.

In order to correct this nonlinear distortion of the image, anadditional voltage E_(dX) ^([8,0]) is added to a voltage, which is amultiple of the step voltage E_(s), and is applied to a scanning point.The additional voltage E_(dX) ^([8,0]) is calculated by the followingequation:E_(dX) ^([8,0])=r_(z) ^([8,0])a_(mag)E_(s)where a coefficient a_(mag) is the above variation quantity a_(mag).

Although, in the above, the method of correcting nonlinear distortion ofthe image in the X direction is described, a method of correctingnonlinear distortion of the image in the Y direction can be alsoperformed by using the Y component of the distortion vectord(x_(i),y_(i)) as z_(i), and y _(i) instead of x_(i).

Instead of adding the distortion correction vector calculation circuit414 to the image generation device 7, a method in which an image of apattern to-be-inspected is transformed to cancel nonlinear distortion ofthe image may be used.

In this embodiment, the number 8 is used for the interval number. Thesmaller the interval number is, the more accurate the distortioncorrection vector is. However, representative distortion vector is moreinaccurate. Therefore, the interval number should be selectedempirically.

According to this embodiment, the method of correcting nonlineardistortion of the image held by the image generation device 7 with thelarge field of view can be performed automatically and accurately for ashort time. Therefore, the field of view can be extended to the portionthat is efficiently corrected by using the correction method.

7.5 Method of Correcting Variation in Line Widths Depending on Positionsof Image of Pattern to-be-Inspected

Another one of the most important distortions of the image of thepattern to-be-inspected is a variation in deformation quantities of linewidths depending on positions of an image of a pattern to-be-inspected.The deformation quantities of the line widths is caused by a variationin an electron beam spot size depending on the positions of the image ofthe pattern to-be-inspected. In order to correct deformation quantitiesof the line widths, a method of correcting variation in line widthsdepending on positions of an image of a pattern to-be-inspected can beused. In this method, distribution of deformation quantities of linewidths is obtained from an image of a pattern to-be-inspectedbeforehand, and a line width in an image of a pattern to-be-inspected iscorrected by using the obtained distribution of deformation quantitiesof line widths.

FIG. 163 is a schematic view showing the above method. As shown bycircles in FIG. 163, an electron beam spot size in a peripheral portionis wider than an electron beam spot size in a central portion. As aresult, an observed line width in the peripheral portion is wider thanan observed line width in the central portion. In the case where theelectron beam spot size is approximately uniform in eachsub-inspection-unit-area, the following method can be used forcorrecting a variation in line widths depending on positions of an imageof a pattern to-be-inspected. In this embodiment, a position ofsub-inspection-unit-area is used for a position of an image of a patternto-be-inspected

1. An image of a pattern to-be-inspected corresponding to an inspectionarea, which includes reference patterns having the same line width andhaving uniform pattern density is acquired beforehand. The part havingperiodical patterns such as part of a memory is suitable for theinspection area.

2. The deformation quantity of line widths with regard to eachsub-inspection-unit-area is calculated from reference patterns and edgesof the image of the pattern to-be-inspected. Distribution of deformationquantities of line widths for each sub-inspection-unit-area is obtained.

3. During inspection, a line width in each sub-inspection-unit-area iscorrected by using the distribution of deformation quantities of linewidths, which is obtained by the above-mentioned step 2. Asub-inspection-unit-area, to which the line width to be correctedbelongs, corresponds to a sub-inspection-unit-area, to which thedeformation quantity of line widths to be used belongs.

The calculation method and the correction method in the above-mentionedstep 2 and step 3 are the same as the methods described in theabove-mentioned 5.11 Method of separating pattern deformation quantitiesinto global pattern deformation quantities and local pattern deformationquantities.

The above correction method may be applied to each group that has thesame line width. In addition, the above correction method may be appliedto areas obtained by dividing a sub-inspection-unit-area.

According to this embodiment, the method of correcting the variation inthe line widths depending on the image positions held by the imagegeneration device 7 with the large field of view can be performedautomatically and accurately for a short time. Therefore, the field ofview can be extended to the portion that is efficiently corrected byusing the correction method.

8. Other Methods

8.1 Method of Extracting Region Suitable for Automatic Image Adjustments

In a long-term inspection, automatic image adjustments, which includeautomatic contrast brightness adjustment, automatic focus adjustment,automatic astigmatism adjustment, and the like, are required. A regionsuitable for automatic contrast brightness adjustment and automaticfocus adjustment corresponds to a region that includes many horizontalor vertical line segments or ends. If the region that meets the aboverequirement is obtained from design data, and then the obtained regionis used for automatic contrast brightness adjustment and automatic focusadjustment, automatic contrast brightness adjustment and automatic focusadjustment can be efficiently performed. Therefore, it is necessary toprovide a method of extracting a region suitable for the automaticcontrast brightness adjustment and automatic focus adjustment.

The method is performed in the following procedure using geometricalinformation of line segments of design data and/or using relationshipbetween line segments of design data that connect or are locatedclosely:

FIG. 164 is a schematic view showing the above method.

1. A size of a rectangular region R used for automatic contrastbrightness adjustment and automatic focus adjustment is determined. Thesize of the rectangular region R is empirically determined.

2. The region A used for automatic contrast brightness adjustment andautomatic focus adjustment is determined. This region A is preferablynear the inspection area. The region A is larger than the region R.

3. While moving the region R relative to the region A, the total lengthof the vertical line segments of design data corresponding to the regionR is obtained. In the same manner, the total length of the horizontalline segments is obtained. The smaller one of the total length of thevertical line segments and the total length of the horizontal linesegments is taken as an estimated value. In this example, the totallength of the line segments is used as geometrical information.

4. The region R having the largest of the estimated values obtained inthe above-mentioned step 3 is regarded as the optimal region (whichincludes many horizontal lines and vertical lines).

The above region R is set into the above-mentioned 3.3 Recipe data “11.The region suitable for automatic contrast brightness adjustment,automatic focus adjustment, and automatic astigmatism adjustment”.Automatic contrast brightness adjustment and automatic focus adjustmentcan be performed timely during inspection using the above registeredregion R.

A region suitable for automatic astigmatism adjustment corresponds to aregion that includes many line segments with the total length indirection of X direction, Y direction, 45 degree direction, and 135degree direction being substantially the same. In this case, theprocedure is performed in the same manner as the above except for usingthe total lengths of 45 degree direction and 135 degree direction inaddition to the total lengths of X direction and Y direction. If theabove region cannot be obtained, partial regions corresponding to endsor corners of design data may be used. In this case, automaticastigmatism adjustment is performed in the following procedure:

First, a region suitable for automatic astigmatism adjustment isobtained. As an example, this region is a region that includes partialregions including a left end and a right end as shown in FIG. 165. Asanother example, this region is a region that includes partial regionsincluding an upper left corner, a lower left corner, an upper rightcorner, and a lower right corner as shown in FIG. 165. These regions maybe replaced with other regions that include partial regions including anupper end and a lower end, for example. If the above regions areobtained, the regions contain omnidirectional edges, and therefore suchregions are suitable for automatic astigmatism adjustment.

The following procedure that is similar to the procedure for obtainingthe region suitable for the above automatic contrast brightnessadjustment and automatic focus adjustment is performed. In this example,the procedure that uses upper left corners, lower left corners, upperright corners, and lower right corners will be described by using FIG.166.

1′. A size of a rectangular region R′ used for astigmatism adjustment isdetermined. The size of the rectangular region R′ is empiricallydetermined.

2′. The region A′ used for astigmatism adjustment is determined. Theregion A′ is larger than the region R′.

3′. While moving the region R′ relative to the region A′, the number ofthe upper left corners of design data corresponding to the region R′ isobtained. In the same manner, the number of the lower left corners, thenumber of the upper right corners, and the number of the lower rightcorners are obtained. The smallest of the number of the upper leftcorners, the lower left corners, the number of the upper right corners,and the number of the lower right corners is taken as an estimatedvalue. In this example, the number of corners is used as geometricalinformation.

4′. The region R′ having the largest of the estimated values obtained inthe above-mentioned step 3′ is regarded as the optimal region (whichincludes many upper left corners, lower left corners, upper rightcorners, and lower right corners).

5′. Some corners are thinned out so that the number of the upper leftcorners, the number of the lower left corners, the number of the upperright corners, and the number of the lower right corners are almost thesame.

The corners and their neighborhoods obtained in the above are used aspartial regions P.

The rectangular region obtained by the above procedure is set into theabove-mentioned 3.3 Recipe data “11. The region suitable for automaticcontrast brightness adjustment, automatic focus adjustment, andautomatic astigmatism adjustment”. Automatic astigmatism adjustment canbe performed timely during inspection using the above registeredrectangular region. This automatic astigmatism adjustment is performedin the following procedure:

1. Automatic focus adjustment is performed.

2. The matching between an image of a pattern to-be-inspected and areference pattern corresponding to the region R′ suitable for automaticastigmatism adjustment is performed.

3. The evaluation value of astigmatism is obtained from partial imagesof the image of the pattern to-be-inspected corresponding to the partialregions P included in the region R′.

4. The above-mentioned step 2 and step 3 are performed while varying avalue of astigmatism.

5. A value of astigmatism corresponding to an optimal evaluation valueof astigmatism obtained in the above-mentioned step 4 is taken as anoptimal astigmatism value.

According to this embodiment, the region suitable for automatic imageadjustments can be extracted automatically and optimally. Further, inthe case of using the partial regions of the image of the patternto-be-inspected as the regions to-be-recognized, automatic imageadjustments may be more accurately performed than in the case where thewhole image of the pattern to-be-inspected is used.

8.2 Automatic Focus Adjustment Method in which the Second Edge DetectionMethod is Used

The conventional automatic focus adjustment used in a CD-SEM isperformed by the following procedure:

1. An image of patterns to-be-inspected is acquired with a focus value.A focus evaluation value, which is a summation of square of the firstdifferentials of the acquired image of the patterns to-be-inspected, isobtained. Another focus evaluation value can be used.

2. The same procedure as the step 1 is repeatedly performed whilealtering the focus value in a range in which an optimal focus valueexists.

3. The largest focus evaluation value is taken from the obtained focusevaluation values. A focus value corresponding to an optimal focusevaluation value is taken as an optimal focus value.

In the case where the conventional automatic focus adjustment used in aCD-SEM is used for the image generation device 7 with a large field ofview, it takes a long time to acquire images of a patternto-be-inspected. In addition, because a large area is scanned, aspecimen is drastically damaged by an electron beam scanning. In orderto solve these problems, an automatic focus adjustment method in whichthe second edge detection is used is performed. In this method, edges ofan image of a pattern to-be-inspected are selectively used.

FIG. 167 is a schematic view showing an automatic focus adjustmentmethod in which the second edge detection method is used. On the upperleft-hand side of FIG. 167, an image of patterns to-be-inspected isshown. The image of the patterns to-be-inspected is acquired whilealtering an excitation current of the objective lens 315, with theexcitation current synchronizing to Y deflector 314. The excitationcurrent means a focus value. A range of altering the focus value is arange in which an optimal focus value exists. On the right-hand side ofFIG. 167, a focus evaluation value obtained from the second edgedetection of the image of the patterns to-be-inspected is shown.

The automatic focus adjustment method in which the second edge detectionis used is performed after processing an inspection-unit-area and in thetime of requiring automatic focus adjustment. Procedure of the automaticfocus adjustment method in which the second edge detection is the sameas the steps S308 (the image generation device 7 outputs an image of apattern to-be-inspected and a center position of the image to theinspection unit 12 for each inspection-unit-area) through S334 (thesecond edge detection) shown in FIG. 25 or FIG. 26 except for thefollowing two items. The region registered in the above-mentioned 3.3Recipe data “11. The region suitable automatic focus adjustment” is usedas the inspection-unit-area in the step S308. The image of the patternsto-be-inspected shown on the left-hand side of FIG. 167 is used as theimage of the pattern to-be-inspected in the step S308. Next, automaticfocus adjustment is performed in the following procedure. Aftercompleting the automatic focus adjustment, the step S308 and later stepsfor the next inspection-unit-area are performed.

As described in the above-mentioned 4.11 The second edge detection, thesecond edges exist in the different positions from positions where theedges should be detected ideally. For example, in the case of using thecoefficient k in FIG. 76 equal to 0.5, the detected edge exists in theposition shifted from the ideal position by the half of the electronbeam spot size in the outward direction of the pattern to-be-inspected.In the case of using 4.11 The second edge detection, the following twofocus evaluation values can be used:

1. In the case where patterns to-be-inspected having the same width inthe same direction occupy an image of patterns to-be-inspected, linewidths of the patterns to-be-inspected are used as the first focusevaluation values. A line width W₁ of the pattern to-be-inspected and aline width W₂ of the pattern to-be-inspected are shown on the lower sideof FIG. 167. The line width W₁ of the pattern to-be-inspected exists ina portion where a focus value is nearly equal to an optimal focus value,and the line width W₂ of the pattern to-be-inspected exists in a portionwhere a focus value is much different from the optimal focus value. Linewidths of a reference pattern corresponding to both of the line widthsW₁ and W₂ are the same.

In the case of an optimal focus value, an electron beam spot size issmallest. In this case, a line width is smallest. Therefore, a focusvalue corresponding to a smaller first focus evaluation value is moreoptimal focus value. According to this embodiment, a focus valuecorresponding to the line width W₁ of the pattern to-be-inspected ismore optimal than a focus value corresponding to the line width W₂ ofthe pattern to-be-inspect, and therefore the result corresponds to thedescription of FIG. 167.

Because a slope of an edge of a pattern to-be-inspected having a largeline width may be different from a slope of an edge of a patternto-be-inspected having a small line width, it is desirable that thefirst focus evaluation values are obtained from patterns to-be-inspectedhaving the same line width. In the case of using patternsto-be-inspected having different line widths, deformation quantities ofline widths are used instead of using line widths.

2. FIG. 168 is a schematic view showing another automatic focusadjustment method in which the second edge detection method is used. Animage of patterns to-be-inspected shown on the upper left-hand side ofFIG. 168 is acquired by the same manner as the manner shown in FIG. 167.In the case of the images of the patterns to-be-inspected in FIG. 167and FIG. 168, distances V₁ and V₂ between peak positions and bottompositions of profiles can be used as the second focus evaluation value.In this case, as with the first focus evaluation value, it is desirablethat the second focus evaluation values are obtained from patternsto-be-inspected having the same line width as much as possible. Inaddition, a focus value corresponding to a smaller second focusevaluation value is more optimal focus value.

In the case of the images of the patterns to-be-inspected in FIG. 167and FIG. 168, the automatic focus adjustment is performed by using thevertical edges. Therefore, accuracy of the automatic focus adjustmentwith regard to horizontal edges is relatively low. However, practically,the automatic focus adjustment, which is performed by using edges in onedirection, is sufficient for automatic focus adjustment in a shortperiod. In the case of FIG. 168, when scanning in the 45 degreedirection is performed, accuracies of the automatic focus adjustmentwith regard to vertical and horizontal edges become high. Further, inthis case, automatic astigmatism adjustment can be performed.

If the minimum focus evaluation value exists in a part where the focusevaluation values does not exist sufficiently in neighborhood, e.g.neighborhoods of parts λ of FIG. 167 and FIG. 168, the image of thepatterns to-be-inspected is acquired again. In this case, the range ofchanging the focus value is adjusted so that the minimum focusevaluation value exists in a position except for the neighborhoods ofthe parts λ.

According to this embodiment, the automatic focus adjustment can beperformed by acquiring one or two images of the patternsto-be-inspected. Therefore, automatic focus adjustment can be performedat high speed. Moreover, a specimen is less damaged by an electron beamscanning. The conventional automatic focus adjustment is performed bycalculating the focus evaluation values from the whole image of thepatterns to-be-inspected. On the other hand, this embodiment isperformed by calculating the focus evaluation values from the edgeparts, which belong to the pattern to-be-inspected having the samewidth, of the image of the patterns to-be-inspected selectively.Therefore, the focus evaluation values are not affected by other parts,and an error rate of automatic focus adjustment can be reduced.

In addition, in the case where a focus value is much different from anoptimal focus value so that matching cannot be performed, the secondedges cannot be detected in this embodiment. In this case, coarseautomatic focus adjustment is performed by the following procedure as apretreatment, and then this embodiment is performed:

This embodiment is performed by using the conventional focus evaluationvalue. For example, a summation of squares of the first differentials ofan image of pattern to-be-inspected is obtained, and a value obtained bymultiplying the summation and (−1) is used as the focus evaluationvalue.

8.3 Method of Selecting the Most Suitable Sub-Inspection-Unit-Area forMatching

As described in FIG. 147, in the case where the inspection-unit-area isvery large, the inspection-unit-area is divided into a plurality of thesub-inspection-unit-areas, and matching is performed by using one of theobtained sub-inspection-unit-areas. Therefore, it is necessary toprovide a method of selecting the most suitable sub-inspection-unit-areafor matching.

The most suitable sub-inspection-unit-area for matching is asub-inspection-unit-area that has the largest of evaluation values ofall sub-inspection-unit-areas. The evaluation value is obtained from thefollowing calculation:

1. Unique patterns are obtained by the method shown in FIGS. 51A and51B.

2. The total lengths of four directional line segments that arehorizontal, vertical, inclined at 45 degrees, and inclined at 135degrees are calculated by classifying the line segments constituting theunique patterns in the four directions.

3. The second largest one of the total lengths of the four directionalline segments is taken as the evaluation value. The reason why thesecond largest total length is used is that at least two sets of linesegments, which have the same direction and the sufficient number ofline segments, are required.

In FIG. 169, two sub-inspection-unit-areas are shown. In FIG. 169,dotted lines represent reference patterns, and solid lines representunique patterns. The sub-inspection-unit-area shown on the left-handside of FIG. 169 has many vertical line segments, but does not have manyhorizontal line segments. On the other hand, thesub-inspection-unit-area shown on the right-hand side of FIG. 169 hasmany vertical line segments and relatively many horizontal linesegments. The total length of line segments constituting unique patternsof the sub-inspection-unit-area shown on the left-hand side of FIG. 169is larger than the total length of line segments constituting uniquepatterns of the sub-inspection-unit-area shown on the right-hand side ofFIG. 169. However, the evaluation value of the sub-inspection-unit-areashown on the left-hand side of FIG. 169 is larger than the evaluationvalue of the sub-inspection-unit-area shown on the right-hand side ofFIG. 169.

In the above description, calculation is performed by usingtwo-dimensional unique patterns. However, this calculation requires ahuge calculation time and is disadvantageous. Therefore, a method thatrequires a less calculation time even if calculation is not perfectlyaccurate has been necessary. This method will be described in FIG. 170.

The most suitable sub-inspection-unit-area for matching is asub-inspection-unit-area that has the largest of evaluation values ofall the sub-inspection-unit-areas. The evaluation value is obtained fromthe following calculation:

1. A one-dimensional data are obtained by classifying the line segmentsconstituting the reference patterns into the four directional linesegments that are horizontal, vertical, inclined at 45 degrees, andinclined at 135 degrees.

2. Unique patterns in the one-dimensional data are obtained by the samemethod as the method shown in FIGS. 51A and 51B. Solid lines shown inthe one-dimensional data of the horizontal line segment and the verticalline segment in FIG. 170 means unique patterns.

3. The total length of line segments of the unique patterns inone-dimensional data of the horizontal line segment is calculated. Inthe same manner, the total lengths with regard to the vertical linesegment, the 45 degree inclined line segment, and the 135 degreeinclined line segment are calculated.

4. The second largest one of the total lengths of the four directionalline segments is taken as the evaluation value.

According to this embodiment, matching can be performed by using thesub-inspection-unit-area that is the most suitable for matching, in thecase where the inspection-unit-area is divided into thesub-inspection-unit-areas. Therefore, the matching using thesub-inspection-unit-area is faster than the matching using the wholeinspection-unit-area.

8.4 Inspection Method in which High-Magnification Image andLow-Magnification Image are Used

In the case of an SEM with a function that enables a part of alow-magnification image of a pattern to-be-inspected to be acquired athigh magnification electromagnetically, an image of a patternto-be-inspected that cannot be acquired in a full view at highmagnification can also be inspected. In this case, an edge position ofan image of a pattern to-be-inspected detected from a high magnificationimage can be converted correctly into an edge position of an image of apattern to-be-inspected of a low-magnification image. The conversion canbe performed by using a high-precision stage. For example, in FIG. 171,if edge positions 182 and 183 of images of a pattern 181 to-be-inspectedare detected from high-magnification images 184 and 185 of the pattern181 to-be-inspected, respectively. These edge positions are convertedinto positions of a low-magnification image 187. A width 186 of thepattern 181 to-be-inspected is obtained from converted edge positions.The obtained width 186 can be inspected more accurately than line widthsthat are inspected by using the low-magnification image 187.

8.5 Display Method of Superimposing Defect Information on InformationCorresponding to the Defect

When defect information, which includes a defect feature and defectimage, is displayed together with at least one of design data, mask data(data created by adding an OPC pattern to the design data), a featureobtained from a lithography simulator using the design data, and datarelated to the design data which correspond to the defect information,it becomes easy to recognize tendencies for defects to be caused.Therefore, it is necessary to provide a method of displaying the relatedinformation and the inspection result together.

The followings are examples of tendencies for defects to be caused:

1. Many defects are detected in dense patterns in the design data.

2. Many defects are detected in the specific OPC pattern.

3. Many defects are detected in shrunken parts of a simulation patternobtained by a lithography simulator.

In the case of wafer inspection, it is effective to use a photomaskimage corresponding to the defect. By comparing the defect image to thephotomask image, whether this defect has been caused by the photomaskcan be easily recognized.

In order to realize the above display, the above data related to thedesign data corresponds to the defect information. The abovecorrespondence is performed in the following procedure:

1. An edge of a reference pattern is added to information of the designdata. As the above additional information, a cell name of a polygon inthe design data to which the edge belongs, a line segment number of apolygon to which the edge belongs, coordinate values of an initial pointand a terminal point of a line segment to which the edge belongs, andcoordinate values of the edge can be used.

2. When a defect is detected, information of the design data added tothe edge of the reference pattern used in the detection is attached toan inspection result.

3. By using the attached information of the design data, the above datarelated to the design data is retrieved. Even if the above data relatedto the design data is described by the different coordinate from thedesign data, the correspondence can be performed by using the cell nameof the polygon, which constitutes design data, and the line segmentnumber.

FIG. 172 shows an example of a display of superimposing design data andmask data on a defect image, and FIGS. 173A, 173B, 173C, and 173D showexamples of displaying detected defects as diagrams. In these example,the following methods are used:

1. A method of displaying a polygon which is an outline of a defect asshown in FIG. 173A.

2. A method of displaying a rectangle which represents the minimumbounding rectangles of dent defects and projection defects as shown inFIG. 173B. In the case of the projection defects, it is possible to addshort line segments at corners of the rectangle in order to distinguishthe projection defects from the dent defects.

3. A method of displaying rectangles whose sides represent line widthsof defects having abnormal line widths as shown in FIGS. 173C and 173D.

In the above methods, the inspection result is directly used fordisplaying. However, a method in which a defect is converted intoadditional information of the design data and is displayed as shown inFIG. 174 can be used. This method is performed in the followingprocedure:

1. The polygons obtained by FIGS. 173A, 173B, 173C, and 173D areconverted into additional information of design data, and are storedinto the design data.

2. In the case where the design data have a layer for describing anactual pattern and a layer for describing a pattern that does not exist,the polygons obtained by FIGS. 173A, 173B, 173C, and 173D are storedinto the layer for describing a pattern that does not exist.

3. In the case where the design data have a plurality of layers fordescribing a pattern that does not exist, the polygons can be storedinto the specified layers for every dent defect, projection defect, anddefect having the abnormal line width. In FIG. 174, design data isstored into the layer 1, the dent defects and the projection defects arestored into the layer 12, and the defects having the abnormal linewidths are stored into the layer 13.

This embodiment is suitable for modification of design becauseinspection result can be reviewed by using an apparatus that handles thedesign data.

The superimposition display described in the above can be replaced witha parallel display. The parallel display is performed in the samemanner.

According to this embodiment, a cause of defects can be easily specifiedand design can be easily modified, because it becomes easy to recognizetendencies for defects to be caused.

8.6 Method of Measuring FEM Wafer

A region of a focus condition and an exposure dose condition is called aprocess window. In order to obtain the process window, an FEM (FocusExposure Matrix) wafer is used. The FEM wafer is a wafer forming amatrix of semiconductor devices, which are fabricated by exposure underthe focus condition continuously altered in the horizontal direction andthe exposure dose condition continuously altered in the verticaldirection. A manner, in which focus condition is continuously altered inthe vertical direction and the exposure dose condition is continuouslyaltered in the horizontal direction, can be used. An example of the FEMwafer is shown in FIG. 175. Large squares in FIG. 175 are semiconductordevices fabricated by exposure under sets of a different focus conditionand a different exposure dose condition.

In order to measure an FEM wafer, several points in all semiconductordevices on the FEM wafer are measured by a CD-SEM conventionally. Thepoints to be measured are points suitable for measuring line widths ofline parts of patterns to-be-inspected. A tendency for patterndeformation quantities is obtained from results of the measurements.Further, a region of a focus condition and an exposure dose condition,which corresponds to a region of semiconductor devices havingdeformation quantities less than an allowable pattern deformationquantity of a line width of a line part, is obtained as a processwindow.

However, the tendency for the pattern deformation quantities with regardto the line widths of the line parts of the patterns to-be-inspected anda tendency for pattern deformation quantities with regard to spacewidths of the line parts of the patterns to-be-inspected or a tendencyfor edge placement errors of ends of the patterns to-be-inspected may bedifferent. In such case, if a process window is obtained from results ofmeasurements with regard to the line widths of the line parts of thepatterns to-be-inspected, a semiconductor fabricated by exposure underconditions in the process window may have a defect.

In order to solve the problem, the process window is obtained by usingthe pattern deformation quantities with regard to the line widths of theline parts of the patterns to-be-inspected, the pattern deformationquantities with regard to the space widths of the line parts of thepatterns to-be-inspected, and the edge placement errors of the ends ofthe patterns to-be-inspected. This method is performed by the followingprocedure:

1. Semiconductor devices are fabricated by exposure under the focuscondition continuously altered in the horizontal direction and theexposure dose condition continuously altered in the vertical direction.The optimal focus condition and the exposure dose condition are used infabrication of a semiconductor device near the center of a FEM wafer. Ina region of the focus condition and the exposure dose condition, mostpatterns to-be-inspected are formed, though pattern deformationquantities exceed an allowable pattern deformation quantity.

2. An area, where patterns to-be-inspected suitable for inspecting linewidths of line parts exist in plenty, is obtained as an inspection area.The inspection area is made small in order to shorten inspection time.All the line widths of the line parts of the patterns to-be-inspected,which exist in the inspection area of each semiconductor device on theFEM wafer, are obtained. An average value of the obtained line widths isobtained for each semiconductor device.

3. A region of a focus condition and an exposure dose condition, whichcorresponds to the semiconductor devices having deformation quantitiesless than an allowable pattern deformation quantity of an average linewidth of a line part, is obtained as a process window with regard to anaverage line width of a line part. A region of a focus condition and anexposure dose condition, which corresponds to squares (semiconductordevices) with a grid pattern shown in FIG. 175, is a process window withregard to an average line width of a line part. The obtained processwindow with regard to an average line width of a line part is equivalentto a process window obtained by the conventional method.

4. Semiconductor devices existing in the boundary of the process windowwith regard to an average line width of a line part are obtained assemiconductor devices to-be-inspected. Squares having Ω's in FIG. 175are examples of the semiconductor devices to-be-inspected.

5. All line widths of line parts, space widths of line parts, and edgeplacement errors of ends of patterns to-be-inspected in the obtainedsemiconductor devices to-be-inspected are inspected to obtain defectdistribution diagrams. The obtained defect distribution diagrams aresuperimposed to obtain a superimposed defect distribution diagram asshown in FIG. 176. An area, which contains defects in plenty, isobtained from the superimposed defect distribution diagram as aninspection area. It is desirable that the number of the defects detectedfrom the line widths of line parts, the number of the defects detectedfrom the space widths of line parts, and the number of the defectsdetected from the edge placement errors of the ends of the patternsto-be-inspected are almost the same. The obtained inspection area iscalled a critical area. The critical area is made small in order toshorten inspection time. A rectangle in FIG. 176 is an example of thecritical area.

6. The critical areas in all the semiconductor devices on the FEM waferare inspected. FIG. 177 is a schematic view showing examples of theresults of the inspection. FIG. 177 is identical to FIG. 175 except fordisplaying the results of inspecting the critical areas. A squarecontaining a small square, a cross, or a triangle shown in FIG. 177shows the semiconductor device which does not contain the defectdetected from the line widths of the line parts, the defect detectedfrom the space widths of the line parts, or the defect detected from theedge placement errors of the ends of the patterns to-be-inspected,respectively. In this embodiment, the process window is obtained byusing the pattern deformation quantities with regard to the line widthsof the line parts, the pattern deformation quantities with regard to thespace widths of the line parts, and the edge placement errors of theends of the patterns to-be-inspected. Therefore, a region of the focuscondition and the exposure dose condition, which corresponds to a regionof squares (semiconductor devices) with a grid pattern shown in FIG.177, is a process window.

Conventionally, the process window is determined by results ofinspecting line widths of line parts of patterns to-be-inspected. Thesquares with a grid pattern in FIG. 175 correspond to the process windowdetermined by the conventional method. However, the process window isdetermined from the squares with a grid pattern in FIG. 177, which isthe results of inspecting the line widths of the line parts, the spacewidths of the line parts, and the edge placement errors of the ends ofthe patterns to-be-inspected, in this embodiment. Therefore, the processwindow obtained by this embodiment is smaller than the process windowobtained by the conventional method. The semiconductor devices, whichcorrespond to the squares with a grid pattern in FIG. 175 and do notcorrespond to the squares with a grid pattern in FIG. 177 meanssemiconductor devices, which may have a defect.

In the case where the critical area is given by a lithography simulatoror the like, the above-mentioned step 6 is performed for the criticalarea.

In this embodiment, the process window is obtained by using the patterndeformation quantities with regard to the line widths of the line parts,the pattern deformation quantities with regard to the space widths ofthe line parts, and the edge placement errors of the ends of thepatterns to-be-inspected. However, other pattern deformation quantitiesfor detecting other defects can be used. As the other defects, thefollowing defects can be used:

A defect of a line part or a corner having edge placement errors;

An isolated pattern having placement error

A defect of a corner having abnormal curvature

A defect detected by inspecting correction pattern that should not beformed on wafer

A defect detected by inspecting an average line width or an averagespace width of a line-shaped pattern

A defect detected by inspecting a line width, an average line width, aspace width, or an average space width of a curvilinear-shaped pattern

A defect detected by inspecting a gate line width

According to this embodiment, the process window is obtained by usingvarious pattern deformation quantities besides the pattern deformationquantities with regard to the line widths of the line parts of thepatterns to-be-inspected. Therefore, more optimal process window can beobtained. Further, more optimal critical area can be obtained than inthe case of using a result of a lithography simulator, because thecritical area is obtained by inspecting the pattern to-be-inspectedactually formed on the FEM wafer.

9. Setting Values

9.1 Setting Values of Parameters of Image Generation Device

Image acquisition methods used in the image generation device 7 in thepattern inspection apparatus according to the embodiment of the presentinvention include a high throughput image acquisition method and a highprecision image acquisition method:

1. High Throughput Image Acquisition Method

The high throughput image acquisition method is a method in whichthroughput is more important than edge detection accuracy. The method isused in inspection of an entire die. In this case, a primary electroncurrent applied to a surface of the wafer W is higher than in the caseof using the high precision image acquisition method in order to acquiresufficient secondary electrons at one time scanning. As a result, anelectron beam spot size becomes bigger, and therefore it is necessaryfor a pixel interval to be wider than in the case of using the highprecision image acquisition method.

From a viewpoint of the second edge detection, it is necessary to covera minimum line width of a pattern to-be-inspected by five pixelintervals or more. The following setting values, which satisfy the aboveconditions, can be used. Values in parentheses described in theright-hand side of the setting values are recommended values, in thecase where a minimum line width of a pattern to-be-inspected is 90 nm.

Primary electron current: 1 nA to 10 nA (3 nA) Landing energy: 1500 eVto 2800 eV (2000 eV) Secondary electron sampling 50 MHz to 200 MHz (100MHz) rate: Number of times of image 1 time to 4 times (1 time)accumulation: Pixel interval: 3 nm to 25 nm (12 nm) Field of view: 20 μmto 300 μm (200 μm)

The primary electron current and landing energy mean values of a currentand energy of primary electrons applied to a surface of the wafer W. Theprimary electrons are described in 2.1 Basic arrangement of imagegeneration device. The primary electron current is also called by aprobe current. The secondary electron sampling rate means the number oftimes of acquiring intensity of the secondary electrons by the secondaryelectron detector 330 in a second. Image accumulation scan means scan,in which the same scanning line is scanned two or more times in order toacquire an accumulated image, as described in 6.5 Method of performinginterlace scan and image-accumulation scan using continuously movingstage. The number of times of image accumulation means the above numberof times, which is two or more times.

In the case where effect of the electrification phenomenon can beignored, intensity of secondary electrons can be higher by increasing alanding energy. In a CD-SEM, 800 eV is used as the landing energy. Inthis case, a contrast image caused by the electrification phenomenonduring image accumulation is acquired. On the other hand, in the highthroughput image acquisition method, a contrast image caused by theelectrification phenomenon cannot be acquired, because one time is usedas the number of times of image accumulation. Therefore, intensity ofsecondary electrons is made higher by increasing the landing energy.

Generally, in the case where the secondary electron sampling rate ismade higher, it is necessary to increase the number of times of imageaccumulation so that accumulated intensity of secondary electrons isidentical to intensity before the secondary electron sampling rate ismade higher. For example, in the case where the secondary electronsampling rate is 100 MHz, one time is enough as the number of times ofimage accumulation in many cases. (This example may depend on otherconditions and a secondary electron generation rate.) In the case wherethe same setting values of parameters are used except for making thesecondary electron sampling rate 200 MHz, it is necessary to make thenumber of times of image accumulation two times.

A pixel interval is multiplied by the number of pixels, and the obtainedproduct is a field of view, as described in 3.3 Recipe data. It isdesirable to make the field of view wide in order to reduce a ratio oftime for moving a stage and waiting at start of scan to time fordetecting secondary electrons. However, due to restriction of precisionof DA converters in the deflection controller 318, the maximum number ofthe pixel number is restricted as 16384, 32768, or the like. Further,the field of view is restricted by aberration of the objective lens 315.The restriction of the field of view in the high throughput imageacquisition method is looser than the restriction of the field of viewin a high precision image acquisition method described later, becausethe pixel interval used in the high throughput image acquisition methodis wider than the pixel interval used in the high precision imageacquisition method.

2. High Precision Image Acquisition Method

A high precision image acquisition method is a method in which edgedetection accuracy is more important than throughput. In this case, itis necessary for a pixel interval to be narrower in order to improve aresolution of an image of a pattern to-be-inspected. Namely, it isnecessary to make an electron beam spot size smaller. Therefore, it isnecessary to increase the number of times of image accumulation. Thefollowing setting values, which satisfy the above conditions, can beused. Values in parentheses described in the right-hand side of thesetting values are recommended values, in the case where a minimum linewidth of a pattern to-be-inspected is 90 nm.

Primary electron current: 100 pA to 2 nA (1 nA) Landing energy: 500 eVto 2800 eV (1000 eV) Secondary electron sampling 50 MHz to 200 MHz (100MHz) rate: Number of times of image 2 times to 32 times (4 times)accumulation: Pixel interval: 2 nm to 6 nm (3 nm) Field of view: 12 μmto 100 μm (20 μm)

The landing energy is determined in consideration of effect of theelectrification phenomenon. In the case where 1000 eV is set as thelanding energy, an image of a pattern to-be-inspected having brightedges and having no contrast between the inside of the pattern and theground is acquired. The acquired image of the pattern to-be-inspected issimilar to an image acquired by a CD-SEM (see FIG. 30). The landingenergy 1000 eV is near to a landing energy 800 eV, which is commonlyused in a CD-SEM. The landing energy 1000 eV is one of the most optimalsetting values. In the case where intensity of secondary electrons isweak with the landing energy 1000 eV being used, 2300 eV can be used asanother one of the most optimal setting values. In this case, intensityof secondary electrons is made higher by increasing the landing energyas described in the high throughput image acquisition method.

3. Electrification Phenomenon Measure

In the case where the electrification phenomenon is caused, interlacescan is efficient. In the interlace scan, the number of lines from twoto 128 are suitable for using as the number of scanning lines between ascanning line and the following scanning line. In addition, in the casewhere effect of the electrification phenomenon cannot be ignored, it isnecessary to apply metal coating, such as platinum palladium, gold, andtungsten, or carbon coating.

9.2 Setting Values of Pixel Interval

A detectable edge placement error or a detectable deformation quantityof a line width and the pixel interval, which is described in 9.1Setting values of parameters of image generation device, have thefollowing relationships:

In the case of an edge placement error of a line part, an edge placementerror, which is around 1.5 times the pixel interval, can be detected. Inthe case of a deformation quantity of a line width of a line part, adeformation quantity, which is around 0.5 times the pixel interval, canbe detected.

It is necessary to determine the pixel interval in consideration of theabove relations and the above-mentioned 3.3 Recipe data “2. The limitvalues of the negative side and the positive side of the allowablepattern deformation quantities”

10. Modifications of Embodiments of Present Invention

While the embodiments of the present invention have been describedabove, various modifications can be used. For example, while a scanningelectron microscope is used in the embodiments as the image generationdevice 7 for scanning a pattern to-be-inspected with an electron beam(charged particle beam) to acquire an image of a patternto-be-inspected, the present invention is also applicable to any ofvarious other scanning microscopes including a scanning focus ion beammicroscope, a scanning laser microscope, and a scanning probemicroscope. The scanning directions are not limited to those at 0 degreeand 90 degrees, but may be those with desired small angles added, e.g.,5 degrees and 95 degrees.

It is possible to modify this embodiment into an off-line inputprocessing system in which an image of a pattern to-be-inspected isinputted through an external input device such as a magneto-optical diskand a magnetic tape or through an LAN (Local Area Network) such as theEthernet.

The image generation method may be replaced by any method other than themethod described in this embodiment, and the reference pattern may betransferred from other type of data. The reference pattern can begenerated during inspecting, instead of being registered with the recipedatabase 22.

Moreover, in this embodiment, the defect information and the like areoutputted to the display device 5 and the printer 6, but may beoutputted to an image database, a simulator, a recording medium, and thelike, or may be transmitted (outputted) to other computers through anetwork.

Furthermore, it is possible to construct a hybrid method in which atypical die, which means a semiconductor device, in a wafer is inspectedby the method according to the present invention, and other dies areinspected by the conventional die-to-die comparison method.

As described above, the present invention offers the followingadvantages:

1. In the case where patterns of design data having the same OPC patterncan be distinguished by a cell name of the design data, repeated defectscaused by an OPC pattern can be recognized by inspecting onesemiconductor device. Consequently, inspection time can be shortened.

Moreover, in the case where repeated defects are recognized from aplurality of semiconductor devices fabricated based on a photomaskhaving a plurality of the same photomask patterns fabricated based ondesign data, more inspection time can be shortened than in the casewhere the entirety of a plurality of semiconductor devices is inspected.In addition, defects can be classified into repeated defects caused byan error of the design data, repeated defects caused by a defect on thephotomask, and random defects.

2. An end except for an end-cap of a wiring pattern and an end to beconnected to a contact hole/via hole may not be corrected by an OPCpattern correctly. Even if the end is shrunken by more than an allowablepattern deformation quantity for an end-cap of a wiring pattern and anend to be connected to a contact hole/via hole, it is not necessary torecognize the shrunken end as a defect. Such shrunken end, which isshrunken by more than the allowable pattern deformation quantity, can beignored.

3. An overlay error distribution over the entire semiconductor devicecan be obtained. Therefore, the local overlay errors caused by a stepperaberration or the like can be controlled.

4. A die-to-die comparison inspection, in which contours of patterns tobe-inspected are used, can be performed with sub pixel accuracy, and canbe performed by using a contour of one image of a patternto-be-inspected, whose pixel interval is different from a pixel intervalof an image of another pattern to-be-inspected, or a contour obtained bya simulator, or the like. Further, a process controlling method in whicha contour of a semiconductor device having good quality at the startingtime of fabrication is used can be realized. Furthermore, becausecorrection of the contour or reduction of spike noise on the contour canbe performed by shifting edges, deterioration of the image of thepattern to-be-inspected caused by the image filter is not caused. As analternative method, in the case where noise on the contour is reduced byusing distances between edges of reference pattern and edges of theimage of the pattern to-be-inspected, variation in curvature of cornerscan be minimized.

5. An inspection method that can be used in combination with analternative method, which performs in slower processing, can berealized. In addition, in the case where a contour is outputted by usingadditional information of design data, relationship between the contourand the design data becomes clear.

6. An optimal allowable pattern deformation quantity can beautomatically obtained by inspecting a standard specimen.

7. For improving quality of a semiconductor device, it can be realizedthat all gate widths in a semiconductor device are measured, themeasured gate widths are classified based on gate lengths, the minimumdistances to the nearest pattern, or the like, and the gate widths areanalyzed.

8. In the case where images of a pattern to-be-inspected on a specimenliable to cause the electrification phenomenon are acquiredsuccessively, the images are distorted gradually. Even if such acquiredimages, which are distorted gradually, are accumulated, a sharpaccumulated image can be obtained.

9. Even if the vectors between the reference pattern and the edges ofthe image of the pattern to-be-inspected may not be obtained necessarilydue to large distortion quantities of the image of the patternto-be-inspected, the distortion quantities of the image of the patternto-be-inspected can be obtained, and then the image of the patternto-be-inspected can be corrected. Further, in the case of obtaining thedistribution of the edges from the edges which exist in a line part ofthe image of the pattern to-be-inspected, even if distribution of edgesof corner parts of the pattern to-be-inspected is asymmetry, it ispossible to prevent deterioration of accuracy of obtaining thedistortion quantities of the image of the pattern to-be-inspected thatis caused by the asymmetry.

10. An image of a pattern to-be-inspected can be acquired by performinginterlace scan and image-accumulation scan, using a continuously movingstage and feedback of a stage position to deflectors. The imageaccumulation scan means scan, in which the same scanning line is scannedtwo or more times in order to acquire an accumulated image.Consequently, inspection speed can be improved.

11. Automatic focus adjustment can be performed by acquiring one or twoimages of the patterns to-be-inspected. Therefore, automatic focusadjustment can be performed at high speed. Moreover, a specimen is lessdamaged by an electron beam scanning.

12. The process window is obtained by using various pattern deformationquantities besides the pattern deformation quantities with regard to theline widths of the line parts of the patterns to-be-inspected.Therefore, more optimal process window can be obtained. Further, moreoptimal critical area can be obtained than in the case of using a resultof a lithography simulator, because the critical area is obtained byinspecting the pattern to-be-inspected actually formed on the wafer.

13. An electron beam mask writer can be evaluated and controlled byobtaining a deformation quantity of exposed patterns fabricated bypatterns used in a writer.

1. A pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of said pattern to-be-inspected anddata for fabricating said pattern to-be-inspected, said patterninspection apparatus comprising: an image generation device configuredto generate said image of said pattern to-be-inspected; and a memorystoring a plurality of machine readable instructions that when executedperform the steps of: (a) storing in said memory a reference patterngenerated from said data, said reference pattern represented by one orboth of (i) one or more line segments, and (ii) one or more curves, saidreference pattern generated from said data; (b) storing in said memorydetected edges of said image; and (c) inspecting said patternto-be-inspected by using at least one of distances between said detectededges and at least one of said line segments and said curves of saidreference pattern to generate defect information, wherein said machinereadable instructions, when executed, detect at least one edge of saidimage by: (i) setting a profile acquisition section by using at leastone of said line segments and said curves of said reference pattern,(ii) obtaining a profile of said image of said pattern-to-be-inspectedby using said profile acquisition section and said image of said patternto-be-inspected, and (iii) detecting said edge from said profile of saidimage of said pattern to-be-inspected.
 2. The pattern inspectionapparatus according to claim 1, wherein said profile includes aplurality of points determined by interpolation of luminance betweenpixels of the image, and wherein detecting edges from said profile isperformed by thresholding interpolated points.
 3. The pattern inspectionapparatus according to claim 1, wherein said machine readableinstructions, when executed, construct an area from said edges of saidimage of said pattern to-be-inspected which fail to correspond to edgesof said reference pattern, and recognize said area as a defective area.4. The pattern inspection apparatus according to claim 1, wherein saidmachine readable instructions, when executed, calculate a patterndeformation quantity of said pattern to-be-inspected from a relationshipof said detected edge of said image of said pattern to-be-inspected andedges obtained by converting said reference pattern, that have beendetermined to be in the correspondence to each other.
 5. A patterninspection apparatus for inspecting a pattern to-be-inspected by usingan image of said pattern to-be-inspected and data for fabricating saidpattern to-be-inspected, said pattern inspection apparatus comprising:an image generation device configured to generate said image of saidpattern to-be-inspected; and a memory storing a plurality of machinereadable instructions that when executed perform the steps of: (a)storing in said memory a reference pattern generated from said data,said reference pattern represented by one or both of (i) one or moreline segments, and (ii) one or more curves, said reference patterngenerated from said data; (b) storing in said memory detected edges ofsaid image; (c) inspecting said pattern to-be-inspected by comparingsaid detected edge with at least one of said line segment and said curveof said reference pattern to generate defect information; (d) setting aprofile acquisition section by using at least one of said line segmentand said curve of said reference pattern; (e) obtaining a profile byusing said profile acquisition section and said image of said patternto-be-inspected; and (f) detecting said edge from said profile.
 6. Thepattern inspection apparatus according to claim 5, wherein said profileincludes a plurality of points determined by interpolation of luminancebetween pixels of the image, and wherein detecting edges from saidprofile is performed by thresholding interpolated points.
 7. A patterninspection apparatus for inspecting a pattern to-be-inspected by usingan image of said pattern to-be-inspected and data for fabricating saidpattern to-be-inspected, said pattern inspection apparatus comprising:an image generation device configured to generate said image of saidpattern to-be-inspected; and a memory storing a plurality of machinereadable instructions that when executed perform the steps of: (a)storing in said memory a reference pattern generated from said data,said reference pattern represented by edge vectors; (b)storing in saidmemory detected edge vectors of said image, said detected edge vectorsof said image detected from said image by using at least one of a zerocrossing of the second derivative of the image and a zero crossing ofthe first derivative of the image; and (c) inspecting said patternto-be-inspected by comparing said edge vectors of said image with saidedge vectors of said reference pattern to generate defect information.8. A pattern matching apparatus for matching a pattern by using an imageof said pattern and data for fabricating said pattern, said patternmatching apparatus comprising: an image generation device configured togenerate said image of said pattern; and a memory storing a plurality ofmachine readable instructions that when executed perform the steps of:(a) storing in said memory a reference pattern generated from said data,said reference pattern represented by edge vectors; (b) storing in saidmemory detected edge vectors of said image, said edge vectors of saidimage detected from said image by using at least one of a zero crossingof the second derivative of the image and a zero crossing of the firstderivative of the image; and (c) matching features of said image andsaid reference pattern by using at least one of said edge vectors ofsaid image of said pattern to-be-inspected and at least one of said edgevectors of said reference pattern.
 9. The pattern inspection apparatusaccording to claim 8, wherein said matching is conducted by dilating atleast one of said edge vectors of said image of said patternto-be-inspected and said edge vectors of said reference pattern.
 10. Thepattern inspection apparatus according to claim 8, wherein said matchingis conducted by using a total sum of products of amplitudes of said edgevectors of said image of said pattern to-be-inspected and amplitudes ofsaid edge vectors of said reference pattern, at respective pixels as anevaluation value.
 11. The pattern inspection apparatus according toclaim 8, wherein said matching is conducted by using a total sum ofinner products of said edge vectors of said image of said patternto-be-inspected and said edge vectors of said reference pattern, atrespective pixels or a total sum of absolute values of said innerproducts as an evaluation value.
 12. The pattern inspection apparatusaccording to claim 8, wherein said matching is conducted by altering acontribution of each part of said reference pattern to said matching.13. The pattern inspection apparatus according to claim 7, wherein saidmachine readable instructions, when executed, determine correspondencebetween said edge vectors of said reference pattern and said edgevectors of said image of said pattern to-be-inspected.
 14. The patterninspection apparatus according to claim 13, wherein said correspondenceis determined by considering a distance between each of said edgevectors of said reference pattern and each of said edge vectors of saidimage of said pattern to-be-inspected.
 15. The pattern inspectionapparatus according to claim 13, wherein said machine readableinstructions, when executed, construct an area from said edge vectors ofsaid image of said pattern to-be-inspected which fail to correspond tosaid edge vectors of said reference pattern, and recognize said area asa defective area.
 16. The pattern inspection apparatus according toclaim 15, wherein said machine readable instructions, when executed,judge a defect class based on geometrical feature quantities of saiddefective area.
 17. The pattern inspection apparatus according to claim15, wherein said machine readable instructions, when executed, judge adefect class based on a feature quantity concerning a luminance of saiddefective area.
 18. The pattern inspection apparatus according to claim13, wherein said machine readable instructions, when executed, constructareas from said edge vectors of said image of said patternto-be-inspected which correspond to said edge vectors of said referencepattern, detect an area whose luminance distribution is non-uniformamong said areas, and recognize said area as a defective area.
 19. Thepattern inspection apparatus according to claim 18, wherein said machinereadable instructions, when executed, judge a defect class based ongeometrical feature quantities of said defective area.
 20. The patterninspection apparatus according to claim 18, wherein said machinereadable instructions, when executed, judge a defect class based on afeature quantity concerning a luminance of said defective area.
 21. Thepattern inspection apparatus according to claim 13, wherein said machinereadable instruction, when executed, calculate a pattern deformationquantity of said pattern to-be-inspected from a relation of said edgevectors of said reference pattern and said edge vectors of said image ofsaid pattern to-be-inspected, that have been determined to correspond toeach other.
 22. The pattern inspection apparatus according to claim 21,wherein said pattern deformation quantity includes at least one of adisplacement quantity, a magnification variation quantity, and adilation quantity of a line width.
 23. The pattern inspection apparatusaccording to claim 21, wherein said machine readable instructions, whenexecuted, add an attribute to said reference pattern.
 24. The patterninspection apparatus according to claim 7, wherein said machine readableinstructions, when executed, set a profile acquisition section by usingat least one of said edge vectors of said reference pattern, obtain aprofile by using said profile acquisition section and said image of saidpattern to-be-inspected, and detect said edge vectors of said image ofsaid pattern to-be-inspected from said profile.
 25. A method ofinspecting a pattern to-be-inspected by using an image of said patternto-be-inspected and data for fabricating said pattern to-be-inspected,said method comprising: generating a reference pattern from said data,said reference pattern represented by edge vectors; generating saidimage of said pattern to-be-inspected; detecting edge vectors of saidimage of said pattern to-be-inspected, said detected edge vectors ofsaid image detected from said image by using at least one of a zerocrossing of the second derivative of the image and a zero crossing ofthe first derivative of the image; and inspecting said patternto-be-inspected by comparing said edge vectors of said image with saidedge vectors of said reference pattern to generate defect information.26. A pattern inspection apparatus for inspecting a patternto-be-inspected by using an image of said pattern to-be-inspected anddata for fabricating said pattern to-be-inspected, said patterninspection apparatus comprising: an image generation device configuredto generate said image of said pattern to-be-inspected; and a memorystoring a plurality of machine readable instructions that when executedperform the steps of: (a) storing in said memory a reference patterngenerated from said data, said reference pattern obtained fromsimulation of fabrication process using said data and represented byedge vectors; (b) storing in said memory detected edge vectors of saidimage, said detected edge vectors of said image detected from said imageby using at least one of a zero crossing of the second derivative of theimage and a zero crossing of the first derivative of the image; and (c)inspecting said pattern to-be-inspected by comparing said edge vectorsof said image with said edge vectors of said reference pattern togenerate defect information.
 27. A pattern inspection apparatus forinspecting a pattern to-be-inspected by using an image of said patternto-be-inspected and data for fabricating said pattern to-be-inspected,said pattern inspection apparatus comprising: an image generation deviceconfigured to generate said image of said pattern to-be-inspected; and amemory storing a plurality of machine readable instructions that whenexecuted perform the steps of: (a) storing in said memory a referencepattern generated from said data, said reference pattern represented byedge vectors; (b) storing in said memory detected edge vectors of saidimage; and (c) inspecting said pattern to-be-inspected by comparing saidedge vectors of said image with said edge vectors of said referencepattern to generate defect information; wherein said machine readableinstructions, when executed, set a profile acquisition section by usingat least one of said edge vectors of said reference pattern, obtain aprofile by using said profile acquisition section and said image of saidpattern to-be-inspected, and detect said edge vectors of said image ofsaid pattern to-be-inspected from said profile.